/* Generated by Cython 3.1.1 */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
/* InitLimitedAPI */
#if defined(Py_LIMITED_API) && !defined(CYTHON_LIMITED_API)
  #define CYTHON_LIMITED_API 1
#endif

#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 < 0x03080000
    #error Cython requires Python 3.8+.
#else
#define __PYX_ABI_VERSION "3_1_1"
#define CYTHON_HEX_VERSION 0x030101F0
#define CYTHON_FUTURE_DIVISION 1
/* CModulePreamble */
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
#if defined(GRAALVM_PYTHON)
  /* For very preliminary testing purposes. Most variables are set the same as PyPy.
     The existence of this section does not imply that anything works or is even tested */
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 1
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 1
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(PYPY_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 1
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #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_AVOID_THREAD_UNSAFE_BORROWED_REFS
  #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #if PY_VERSION_HEX < 0x03090000
    #undef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #undef CYTHON_USE_MODULE_STATE
  #define CYTHON_USE_MODULE_STATE 0
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  #endif
  #undef CYTHON_USE_AM_SEND
  #define CYTHON_USE_AM_SEND 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#elif defined(CYTHON_LIMITED_API)
  #ifdef Py_LIMITED_API
    #undef __PYX_LIMITED_VERSION_HEX
    #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  #endif
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #define CYTHON_COMPILING_IN_GRAAL 0
  #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #undef CYTHON_CLINE_IN_TRACEBACK
  #define CYTHON_CLINE_IN_TRACEBACK 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_TYPE_SPECS
  #define CYTHON_USE_TYPE_SPECS 1
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_ASSUME_SAFE_SIZE
  #define CYTHON_ASSUME_SAFE_SIZE 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #undef CYTHON_USE_SYS_MONITORING
  #define CYTHON_USE_SYS_MONITORING 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 0
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
  #undef CYTHON_USE_FREELISTS
  #define CYTHON_USE_FREELISTS 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #define CYTHON_COMPILING_IN_GRAAL 0
  #ifdef Py_GIL_DISABLED
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  #else
    #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  #endif
  #if PY_VERSION_HEX < 0x030A0000
    #undef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #elif !defined(CYTHON_USE_TYPE_SLOTS)
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_TYPE_SPECS
    #define CYTHON_USE_TYPE_SPECS 0
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
    #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_ASSUME_SAFE_SIZE
    #define CYTHON_ASSUME_SAFE_SIZE 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL 0
  #elif !defined(CYTHON_FAST_GIL)
    #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_MODULE_STATE
    #define CYTHON_USE_MODULE_STATE 0
  #endif
  #ifndef CYTHON_USE_SYS_MONITORING
    #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #ifndef CYTHON_USE_AM_SEND
    #define CYTHON_USE_AM_SEND 1
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    #undef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS 0
  #elif !defined(CYTHON_USE_DICT_VERSIONS)
    #define CYTHON_USE_DICT_VERSIONS  (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 1
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
  #ifndef CYTHON_USE_FREELISTS
    #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  #endif
#endif
#ifndef CYTHON_FAST_PYCCALL
#define CYTHON_FAST_PYCCALL  CYTHON_FAST_PYCALL
#endif
#ifndef CYTHON_VECTORCALL
#if CYTHON_COMPILING_IN_LIMITED_API
#define CYTHON_VECTORCALL  (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
#else
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(maybe_unused)
        #define CYTHON_UNUSED [[maybe_unused]]
      #endif
    #endif
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_USE_CPP_STD_MOVE
  #if defined(__cplusplus) && (\
    __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
    #define CYTHON_USE_CPP_STD_MOVE 1
  #else
    #define CYTHON_USE_CPP_STD_MOVE 0
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
            typedef unsigned char     uint8_t;
            typedef unsigned short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus)
    /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
     * but leads to warnings with -pedantic, since it is a C++17 feature */
    #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
      #if __has_cpp_attribute(fallthrough)
        #define CYTHON_FALLTHROUGH [[fallthrough]]
      #endif
    #endif
    #ifndef CYTHON_FALLTHROUGH
      #if __has_cpp_attribute(clang::fallthrough)
        #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
      #elif __has_cpp_attribute(gnu::fallthrough)
        #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
      #endif
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif
#ifndef Py_UNREACHABLE
  #define Py_UNREACHABLE()  assert(0); abort()
#endif
#ifdef __cplusplus
  template <typename T>
  struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
#else
  #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
#endif
#if CYTHON_COMPILING_IN_PYPY == 1
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
#else
  #define __PYX_NEED_TP_PRINT_SLOT  (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
#endif
#define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))

/* CppInitCode */
#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 ==(const U& other) const { return *ptr == other; }
    template<typename U> bool operator !=(const U& other) const { return *ptr != other; }
    template<typename U> bool operator==(const __Pyx_FakeReference<U>& other) const { return *ptr == *other.ptr; }
    template<typename U> bool operator!=(const __Pyx_FakeReference<U>& other) const { return *ptr != *other.ptr; }
  private:
    T *ptr;
};

/* PythonCompatibility */
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_DefaultClassType PyType_Type
#if CYTHON_COMPILING_IN_LIMITED_API
    #ifndef CO_OPTIMIZED
    static int CO_OPTIMIZED;
    #endif
    #ifndef CO_NEWLOCALS
    static int CO_NEWLOCALS;
    #endif
    #ifndef CO_VARARGS
    static int CO_VARARGS;
    #endif
    #ifndef CO_VARKEYWORDS
    static int CO_VARKEYWORDS;
    #endif
    #ifndef CO_ASYNC_GENERATOR
    static int CO_ASYNC_GENERATOR;
    #endif
    #ifndef CO_GENERATOR
    static int CO_GENERATOR;
    #endif
    #ifndef CO_COROUTINE
    static int CO_COROUTINE;
    #endif
#else
    #ifndef CO_COROUTINE
      #define CO_COROUTINE 0x80
    #endif
    #ifndef CO_ASYNC_GENERATOR
      #define CO_ASYNC_GENERATOR 0x200
    #endif
#endif
static int __Pyx_init_co_variables(void);
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  #define __Pyx_Py_Is(x, y)  Py_Is(x, y)
#else
  #define __Pyx_Py_Is(x, y) ((x) == (y))
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
#else
  #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
#else
  #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
#endif
#if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
#else
  #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
#endif
#define __Pyx_NoneAsNull(obj)  (__Pyx_Py_IsNone(obj) ? NULL : (obj))
#if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
#else
  #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef Py_TPFLAGS_SEQUENCE
  #define Py_TPFLAGS_SEQUENCE 0
#endif
#ifndef Py_TPFLAGS_MAPPING
  #define Py_TPFLAGS_MAPPING 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#ifndef METH_FASTCALL
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #if PY_VERSION_HEX >= 0x030d00A4
  #  define __Pyx_PyCFunctionFast PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  #else
  #  define __Pyx_PyCFunctionFast _PyCFunctionFast
  #  define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  #endif
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if PY_VERSION_HEX >= 0x030900B1
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_CheckExact(func)
#else
#define __Pyx_PyCFunction_CheckExact(func)  PyCFunction_Check(func)
#endif
#define __Pyx_CyOrPyCFunction_Check(func)  PyCFunction_Check(func)
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  (((PyCFunctionObject*)(func))->m_ml->ml_meth)
#elif !CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyOrPyCFunction_GET_FUNCTION(func)  PyCFunction_GET_FUNCTION(func)
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CyOrPyCFunction_GET_FLAGS(func)  (((PyCFunctionObject*)(func))->m_ml->ml_flags)
static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
    return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
}
#endif
static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
#if CYTHON_COMPILING_IN_LIMITED_API
    return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
#else
    return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
#endif
}
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCFunction(func, cfunc)
#if __PYX_LIMITED_VERSION_HEX < 0x03090000
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  ((void)m, PyType_FromSpecWithBases(s, b))
  typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
#else
  #define __Pyx_PyType_FromModuleAndSpec(m, s, b)  PyType_FromModuleAndSpec(m, s, b)
  #define __Pyx_PyCMethod  PyCMethod
#endif
#ifndef METH_METHOD
  #define METH_METHOD 0x200
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_GRAAL
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x030d00A1
  #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#endif
#if CYTHON_USE_MODULE_STATE
static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
#else
#define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
#endif
#define __Pyx_PyObject_GetSlot(obj, name, func_ctype)  __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
#define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
#define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((type)->name)
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
#else
  #define __Pyx_PyType_GetSlot(type, name, func_ctype)  ((func_ctype) PyType_GetSlot((type), Py_##name))
  #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
    ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
     (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
     __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
#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
#define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
#else
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
#endif
#define __Pyx_PyObject_GetIterNextFunc(iterator)  __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
#if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  {\
    PyTypeObject *type = Py_TYPE((PyObject*)obj);\
    assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
    PyObject_GC_Del(obj);\
    Py_DECREF(type);\
}
#else
#define __Pyx_PyHeapTypeObject_GC_Del(obj)  PyObject_GC_Del(obj)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111U)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#else
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_READY(op)       (0)
  #else
    #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                                0 : _PyUnicode_Ready((PyObject *)(op)))
  #endif
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  #if PY_VERSION_HEX >= 0x030C0000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #else
    #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
    #else
    #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
    #endif
  #endif
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains)
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
  #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  #else
    #define __Pyx_PyList_GetItemRef(o, i) PySequence_GetItem(o, i)
  #endif
#else
  #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyObject_GetItem(dict, key);
  if (*result == NULL) {
    if (PyErr_ExceptionMatches(PyExc_KeyError)) {
      PyErr_Clear();
      return 0;
    }
    return -1;
  }
  return 1;
}
#else
static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  *result = PyDict_GetItemWithError(dict, key);
  if (*result == NULL) {
    return PyErr_Occurred() ? -1 : 0;
  }
  Py_INCREF(*result);
  return 1;
}
#endif
#if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  #define __Pyx_VISIT_CONST(obj)  Py_VISIT(obj)
#else
  #define __Pyx_VISIT_CONST(obj)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
#else
  #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
  #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
#endif
#if CYTHON_ASSUME_SAFE_SIZE
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
#else
  #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
#endif
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
#else
  static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
      PyObject *module = PyImport_AddModule(name);
      Py_XINCREF(module);
      return module;
  }
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
#endif
#define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
#define __Pyx_PyLong_AsHash_t   __Pyx_PyIndex_AsSsize_t
#if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
    #define __Pyx_PySendResult PySendResult
#else
    typedef enum {
        PYGEN_RETURN = 0,
        PYGEN_ERROR = -1,
        PYGEN_NEXT = 1,
    } __Pyx_PySendResult;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
#else
  #define __Pyx_pyiter_sendfunc sendfunc
#endif
#if !CYTHON_USE_AM_SEND
#define __PYX_HAS_PY_AM_SEND 0
#elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
#define __PYX_HAS_PY_AM_SEND 1
#else
#define __PYX_HAS_PY_AM_SEND 2  // our own backported implementation
#endif
#if __PYX_HAS_PY_AM_SEND < 2
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#else
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
        __Pyx_pyiter_sendfunc am_send;
    } __Pyx_PyAsyncMethodsStruct;
    #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
#endif
#if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
#else
    #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
#endif
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
#else
#define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
#endif
#if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
#ifdef __cplusplus
extern "C"
#endif
PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
    int value;
    PyObject *py_value = PyObject_GetAttrString(inspect, name);
    if (!py_value) return 0;
    value = (int) PyLong_AsLong(py_value);
    Py_DECREF(py_value);
    *write_to = value;
    return value != -1 || !PyErr_Occurred();
}
static int __Pyx_init_co_variables(void) {
    PyObject *inspect;
    int result;
    inspect = PyImport_ImportModule("inspect");
    result =
#if !defined(CO_OPTIMIZED)
        __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
#endif
#if !defined(CO_NEWLOCALS)
        __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
#endif
#if !defined(CO_VARARGS)
        __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
#endif
#if !defined(CO_VARKEYWORDS)
        __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
#endif
#if !defined(CO_ASYNC_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
#endif
#if !defined(CO_GENERATOR)
        __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
#endif
#if !defined(CO_COROUTINE)
        __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
#endif
        1;
    Py_DECREF(inspect);
    return result ? 0 : -1;
}
#else
static int __Pyx_init_co_variables(void) {
    return 0;  // It's a limited API-only feature
}
#endif

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

#ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
#endif
#ifndef CYTHON_CLINE_IN_TRACEBACK
#define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
#endif
#if CYTHON_CLINE_IN_TRACEBACK
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
#else
#define __PYX_MARK_ERR_POS(f_index, lineno)  { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
#endif
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

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

#define __PYX_HAVE__pywrapfst
#define __PYX_HAVE_API__pywrapfst
/* Early includes */
#include <stdint.h>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <memory>
#include <string.h>
#include <string_view>
#include <string>
#include <utility>

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

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

    #endif
    
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
#include <optional>
#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 <limits>
#include <fst/compat.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 1
#define __Pyx_PyObject_FromString __Pyx_PyUnicode_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if CYTHON_ASSUME_SAFE_MACROS
    #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_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
#else
    #define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AsString(s))
    #define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AsString(s))
    #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
#endif
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#define __Pyx_PyUnicode_FromOrdinal(o)       PyUnicode_FromOrdinal((int)o)
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
    return Py_NewRef(obj);
#else
    Py_INCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
    return Py_XNewRef(obj);
#else
    Py_XINCREF(obj);
    return obj;
#endif
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(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_PyLong_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
#else
#define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
#endif
#define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_VERSION_HEX >= 0x030C00A7
  #ifndef _PyLong_SIGN_MASK
    #define _PyLong_SIGN_MASK 3
  #endif
  #ifndef _PyLong_NON_SIZE_BITS
    #define _PyLong_NON_SIZE_BITS 3
  #endif
  #define __Pyx_PyLong_Sign(x)  (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  #define __Pyx_PyLong_IsNeg(x)  ((__Pyx_PyLong_Sign(x) & 2) != 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (!__Pyx_PyLong_IsNeg(x))
  #define __Pyx_PyLong_IsZero(x)  (__Pyx_PyLong_Sign(x) & 1)
  #define __Pyx_PyLong_IsPos(x)  (__Pyx_PyLong_Sign(x) == 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  (__Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  #define __Pyx_PyLong_SignedDigitCount(x)\
        ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
  #else
    #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
    #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  #endif
  typedef Py_ssize_t  __Pyx_compact_pylong;
  typedef size_t  __Pyx_compact_upylong;
  #else
  #define __Pyx_PyLong_IsNeg(x)  (Py_SIZE(x) < 0)
  #define __Pyx_PyLong_IsNonNeg(x)  (Py_SIZE(x) >= 0)
  #define __Pyx_PyLong_IsZero(x)  (Py_SIZE(x) == 0)
  #define __Pyx_PyLong_IsPos(x)  (Py_SIZE(x) > 0)
  #define __Pyx_PyLong_CompactValueUnsigned(x)  ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  #define __Pyx_PyLong_DigitCount(x)  __Pyx_sst_abs(Py_SIZE(x))
  #define __Pyx_PyLong_SignedDigitCount(x)  Py_SIZE(x)
  #define __Pyx_PyLong_IsCompact(x)  (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  #define __Pyx_PyLong_CompactValue(x)\
        ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  typedef sdigit  __Pyx_compact_pylong;
  typedef digit  __Pyx_compact_upylong;
  #endif
  #if PY_VERSION_HEX >= 0x030C00A5
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->long_value.ob_digit)
  #else
  #define __Pyx_PyLong_Digits(x)  (((PyLongObject*)x)->ob_digit)
  #endif
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
#else
  #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#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__ */
/* PretendToInitialize */
#ifdef __cplusplus
#include <type_traits>
template <typename T>
static void __Pyx_pretend_to_initialize(T* ptr) {
#if __cplusplus > 201103L
    if ((std::is_trivially_default_constructible<T>::value))
#endif
        *ptr = T();
    (void)ptr;
}
#else
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
#endif


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

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

static const char* const __pyx_f[] = {
  "pywrapfst.pyx",
  "<stringsource>",
};
/* #### Code section: utility_code_proto_before_types ### */
/* Atomics.proto */
#include <pythread.h>
#ifndef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 1
#endif
#define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
#define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __pyx_atomic_int_type int
#define __pyx_nonatomic_int_type int
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__))
    #include <stdatomic.h>
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)))
    #include <atomic>
#endif
#if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
                        (__STDC_VERSION__ >= 201112L) &&\
                        !defined(__STDC_NO_ATOMICS__) &&\
                       ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type atomic_int
    #define __pyx_atomic_ptr_type atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) atomic_load(value)
    #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C atomics"
    #endif
#elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
                    (__cplusplus >= 201103L) ||\
\
                    (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
                    ATOMIC_INT_LOCK_FREE == 2)
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type std::atomic_int
    #define __pyx_atomic_ptr_type std::atomic_uintptr_t
    #define __pyx_nonatomic_ptr_type uintptr_t
    #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
    #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
    #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
    #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
    #define __pyx_atomic_load(value) std::atomic_load(value)
    #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
    #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
    #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
    #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
        #pragma message ("Using standard C++ atomics")
    #elif defined(__PYX_DEBUG_ATOMICS)
        #warning "Using standard C++ atomics"
    #endif
#elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
                    (__GNUC_MINOR__ > 1 ||\
                    (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
    #define __pyx_atomic_ptr_type void*
    #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
    #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Using GNU atomics"
    #endif
#elif CYTHON_ATOMICS && defined(_MSC_VER)
    #include <intrin.h>
    #undef __pyx_atomic_int_type
    #define __pyx_atomic_int_type long
    #define __pyx_atomic_ptr_type void*
    #undef __pyx_nonatomic_int_type
    #define __pyx_nonatomic_int_type long
    #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
    #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
    #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
    #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
    static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
        __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
        int result = old == *expected;
        *expected = old;
        return result;
    }
    #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
    #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
    #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
    #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
    #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
    #ifdef __PYX_DEBUG_ATOMICS
        #pragma message ("Using MSVC atomics")
    #endif
#else
    #undef CYTHON_ATOMICS
    #define CYTHON_ATOMICS 0
    #ifdef __PYX_DEBUG_ATOMICS
        #warning "Not using atomics"
    #endif
#endif
#if CYTHON_ATOMICS
    #define __pyx_add_acquisition_count(memview)\
             __pyx_atomic_incr_relaxed(__pyx_get_slice_count_pointer(memview))
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_atomic_decr_acq_rel(__pyx_get_slice_count_pointer(memview))
#else
    #define __pyx_add_acquisition_count(memview)\
            __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
    #define __pyx_sub_acquisition_count(memview)\
            __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
#endif

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

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

/* CriticalSections.proto */
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
#define __Pyx_PyCriticalSection void*
#define __Pyx_PyCriticalSection2 void*
#define __Pyx_PyCriticalSection_Begin1(cs, arg) (void)cs
#define __Pyx_PyCriticalSection_Begin2(cs, arg1, arg2) (void)cs
#define __Pyx_PyCriticalSection_End1(cs)
#define __Pyx_PyCriticalSection_End2(cs)
#else
#define __Pyx_PyCriticalSection PyCriticalSection
#define __Pyx_PyCriticalSection2 PyCriticalSection2
#define __Pyx_PyCriticalSection_Begin1 PyCriticalSection_Begin
#define __Pyx_PyCriticalSection_Begin2 PyCriticalSection2_Begin
#define __Pyx_PyCriticalSection_End1 PyCriticalSection_End
#define __Pyx_PyCriticalSection_End2 PyCriticalSection2_End
#endif
#if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_BEGIN_CRITICAL_SECTION(o) {
#define __Pyx_END_CRITICAL_SECTION() }
#else
#define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
#define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
#endif

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

/*--- Type declarations ---*/
struct __pyx_obj_9pywrapfst_Weight;
struct __pyx_obj_9pywrapfst_SymbolTableView;
struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView;
struct __pyx_obj_9pywrapfst__FstSymbolTableView;
struct __pyx_obj_9pywrapfst__MutableSymbolTable;
struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView;
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_VectorFst;
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;
struct __pyx_defaults;

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

/* "cpywrapfst.pxd":525
 * ctypedef pair[int64_t, const FstClass *] LabelFstClassPair
 * 
 * ctypedef pair[int64_t, int64_t] LabelPair             # <<<<<<<<<<<<<<
 * 
 * 
*/
typedef std::pair<int64_t,int64_t>  __pyx_t_10cpywrapfst_LabelPair;
struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol;
struct __pyx_opt_args_9pywrapfst_3Fst_draw;
struct __pyx_opt_args_9pywrapfst_3Fst_print;
struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort;
struct __pyx_opt_args_9pywrapfst_10MutableFst__closure;
struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_arcs;
struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_states;
struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize;
struct __pyx_opt_args_9pywrapfst_10MutableFst__prune;
struct __pyx_opt_args_9pywrapfst_10MutableFst__push;
struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs;
struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables;
struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight;
struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon;
struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final;
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":103
 * # SymbolTable.
 * 
 * ctypedef fst.SymbolTable * SymbolTable_ptr             # <<<<<<<<<<<<<<
 * ctypedef const fst.SymbolTable * const_SymbolTable_ptr
 * 
*/
typedef fst::SymbolTable *__pyx_t_9pywrapfst_SymbolTable_ptr;

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

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

/* "pywrapfst.pxd":205
 * 
 * 
 * ctypedef fst.EncodeMapperClass * EncodeMapperClass_ptr             # <<<<<<<<<<<<<<
 * 
 * 
*/
typedef fst::script::EncodeMapperClass *__pyx_t_9pywrapfst_EncodeMapperClass_ptr;

/* "pywrapfst.pxd":239
 * 
 * 
 * ctypedef fst.FstClass * FstClass_ptr             # <<<<<<<<<<<<<<
 * ctypedef const fst.FstClass * const_FstClass_ptr
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr
*/
typedef fst::script::FstClass *__pyx_t_9pywrapfst_FstClass_ptr;

/* "pywrapfst.pxd":240
 * 
 * ctypedef fst.FstClass * FstClass_ptr
 * ctypedef const fst.FstClass * const_FstClass_ptr             # <<<<<<<<<<<<<<
 * ctypedef fst.MutableFstClass * MutableFstClass_ptr
 * ctypedef fst.VectorFstClass * VectorFstClass_ptr
*/
typedef fst::script::FstClass const *__pyx_t_9pywrapfst_const_FstClass_ptr;

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

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

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

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

/* "pywrapfst.pxd":331
 *   cpdef void add_states(self, size_t)
 * 
 *   cdef void _arcsort(self, sort_type=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _closure(self, closure_type=?)
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort {
  int __pyx_n;
  PyObject *sort_type;
};

/* "pywrapfst.pxd":333
 *   cdef void _arcsort(self, sort_type=?) except *
 * 
 *   cdef void _closure(self, closure_type=?)             # <<<<<<<<<<<<<<
 * 
 *   cdef void _concat(self, Fst fst2) except *
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__closure {
  int __pyx_n;
  PyObject *closure_type;
};

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

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

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

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

/* "pywrapfst.pxd":359
 *   cdef void _prune(self, float delta=?, int64_t nstate=?, weight=?) except *
 * 
 *   cdef void _push(self,             # <<<<<<<<<<<<<<
 *                   float delta=?,
 *                   bool remove_total_weight=?,
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__push {
  int __pyx_n;
  float delta;
  bool remove_total_weight;
  PyObject *reweight_type;
};

/* "pywrapfst.pxd":364
 *                   reweight_type=?)
 * 
 *   cdef void _relabel_pairs(self, ipairs=?, opairs=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _relabel_tables(self,
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs {
  int __pyx_n;
  PyObject *ipairs;
  PyObject *opairs;
};

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

/* "pywrapfst.pxd":380
 *   cdef void _reserve_states(self, int64_t n)
 * 
 *   cdef void _reweight(self, potentials, reweight_type=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _rmepsilon(self,
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight {
  int __pyx_n;
  PyObject *reweight_type;
};

/* "pywrapfst.pxd":382
 *   cdef void _reweight(self, potentials, reweight_type=?) except *
 * 
 *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
 *                        queue_type=?,
 *                        bool connect=?,
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon {
  int __pyx_n;
  PyObject *queue_type;
  bool connect;
  PyObject *weight;
  int64_t nstate;
  float delta;
};

/* "pywrapfst.pxd":389
 *                        float delta=?) except *
 * 
 *   cdef void _set_final(self, int64_t state, weight=?) except *             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_start(self, int64_t state) except *
*/
struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final {
  int __pyx_n;
  PyObject *weight;
};

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

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

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

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

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

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

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

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

/* "pywrapfst.pxd":521
 * cpdef MutableFst epsnormalize(Fst ifst, eps_norm_type=?)
 * 
 * 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":523
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=?)
 * 
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=?) except *             # <<<<<<<<<<<<<<
 * 
 * cpdef MutableFst intersect(Fst ifst1,
*/
struct __pyx_opt_args_9pywrapfst_equivalent {
  int __pyx_n;
  float delta;
};

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

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

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

/* "pywrapfst.pxd":537
 *                        weight=?)
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=?,
 *                       bool push_weights=?,
*/
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;
  PyObject *reweight_type;
};

/* "pywrapfst.pxd":545
 *                       reweight_type=?)
 * 
 * cpdef bool randequivalent(Fst ifst1,             # <<<<<<<<<<<<<<
 *                           Fst ifst2,
 *                           int32_t npath=?,
*/
struct __pyx_opt_args_9pywrapfst_randequivalent {
  int __pyx_n;
  int32_t npath;
  float delta;
  PyObject *select;
  int32_t max_length;
  uint64_t seed;
};

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

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

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

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

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

/* "pywrapfst.pxd":71
 * 
 * 
 * cdef class Weight:             # <<<<<<<<<<<<<<
 * 
 *   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":107
 * 
 * 
 * cdef class SymbolTableView:             # <<<<<<<<<<<<<<
 * 
 *   cdef const fst.SymbolTable *_raw(self)
*/
struct __pyx_obj_9pywrapfst_SymbolTableView {
  PyObject_HEAD
  struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *__pyx_vtab;
};


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


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


/* "pywrapfst.pxd":152
 * 
 * 
 * cdef class _MutableSymbolTable(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   cdef fst.SymbolTable *_mutable_raw(self)
*/
struct __pyx_obj_9pywrapfst__MutableSymbolTable {
  struct __pyx_obj_9pywrapfst_SymbolTableView __pyx_base;
};


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


/* "pywrapfst.pxd":173
 * 
 * 
 * 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":196
 * 
 * 
 * cdef class _SymbolTableIterator:             # <<<<<<<<<<<<<<
 * 
 *   cdef SymbolTableView _table
*/
struct __pyx_obj_9pywrapfst__SymbolTableIterator {
  PyObject_HEAD
  struct __pyx_obj_9pywrapfst_SymbolTableView *_table;
  std::unique_ptr<fst::SymbolTable::iterator>  _it;
};


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


/* "pywrapfst.pxd":245
 * 
 * 
 * cdef class Fst:             # <<<<<<<<<<<<<<
 * 
 *   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":319
 * 
 * 
 * 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":400
 * 
 * 
 * cdef class VectorFst(MutableFst):             # <<<<<<<<<<<<<<
 * 
 *     pass
*/
struct __pyx_obj_9pywrapfst_VectorFst {
  struct __pyx_obj_9pywrapfst_MutableFst __pyx_base;
};


/* "pywrapfst.pxd":422
 * 
 * 
 * cdef class Arc:             # <<<<<<<<<<<<<<
 * 
 *   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":432
 * 
 * 
 * cdef class _ArcIterator:             # <<<<<<<<<<<<<<
 * 
 *   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>  _it;
};


/* "pywrapfst.pxd":450
 * 
 * 
 * cdef class _MutableArcIterator(_ArcIterator):             # <<<<<<<<<<<<<<
 * 
 *   cdef shared_ptr[fst.MutableFstClass] _mfst
*/
struct __pyx_obj_9pywrapfst__MutableArcIterator {
  struct __pyx_obj_9pywrapfst__ArcIterator __pyx_base;
  std::shared_ptr<fst::script::MutableFstClass>  _mfst;
  std::unique_ptr<fst::script::MutableArcIteratorClass>  _mit;
};


/* "pywrapfst.pxd":470
 * 
 * 
 * cdef class _StateIterator:             # <<<<<<<<<<<<<<
 * 
 *   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>  _it;
};


/* "pywrapfst.pxd":592
 * 
 * 
 * cdef class Compiler:             # <<<<<<<<<<<<<<
 * 
 *   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;
};


/* "pywrapfst.pxd":612
 * # FarReader.
 * 
 * cdef class FarReader:             # <<<<<<<<<<<<<<
 * 
 *   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":637
 * # FarWriter.
 * 
 * cdef class FarWriter:             # <<<<<<<<<<<<<<
 * 
 *   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":4565
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64_t nstate=fst.kNoStateId,
*/
struct __pyx_defaults {
  PyObject_HEAD
  float arg0;
  int64_t arg1;
};



/* "pywrapfst.pyx":482
 * 
 * 
 * cdef class Weight:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

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 (*type)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch);
  std::string (*to_string)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch);
  bool (*member)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_Weight *__pyx_vtabptr_9pywrapfst_Weight;


/* "pywrapfst.pyx":822
 * 
 * 
 * cdef class SymbolTableView:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

struct __pyx_vtabstruct_9pywrapfst_SymbolTableView {
  fst::SymbolTable const *(*_raw)(struct __pyx_obj_9pywrapfst_SymbolTableView *);
  void (*_raise_nonexistent)(struct __pyx_obj_9pywrapfst_SymbolTableView *);
  fst::SymbolTable const *(*_raw_ptr_or_raise)(struct __pyx_obj_9pywrapfst_SymbolTableView *);
  int64_t (*available_key)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  PyObject *(*checksum)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst_SymbolTable *(*copy)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  int64_t (*get_nth_key)(struct __pyx_obj_9pywrapfst_SymbolTableView *, Py_ssize_t, int __pyx_skip_dispatch);
  PyObject *(*labeled_checksum)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  bool (*member)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch);
  std::string (*name)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  size_t (*num_symbols)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*write_to_string)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *__pyx_vtabptr_9pywrapfst_SymbolTableView;


/* "pywrapfst.pyx":1042
 * 
 * 
 * cdef class _EncodeMapperSymbolTableView(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   """
*/

struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView {
  struct __pyx_vtabstruct_9pywrapfst_SymbolTableView __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView *__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView;


/* "pywrapfst.pyx":1066
 * 
 * 
 * cdef class _FstSymbolTableView(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   """
*/

struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView {
  struct __pyx_vtabstruct_9pywrapfst_SymbolTableView __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView *__pyx_vtabptr_9pywrapfst__FstSymbolTableView;


/* "pywrapfst.pyx":1089
 * 
 * 
 * cdef class _MutableSymbolTable(SymbolTableView):             # <<<<<<<<<<<<<<
 * 
 *   """
*/

struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable {
  struct __pyx_vtabstruct_9pywrapfst_SymbolTableView __pyx_base;
  fst::SymbolTable *(*_mutable_raw)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *);
  fst::SymbolTable *(*_mutable_raw_ptr_or_raise)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *);
  int64_t (*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_SymbolTableView *, 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":1170
 * 
 * 
 * cdef class _MutableFstSymbolTableView(_MutableSymbolTable):             # <<<<<<<<<<<<<<
 *   """
 *   (No constructor.)
*/

struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView {
  struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView *__pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView;


/* "pywrapfst.pyx":1185
 * 
 * 
 * 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":1423
 * 
 * 
 * cdef class EncodeMapper:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

struct __pyx_vtabstruct_9pywrapfst_EncodeMapper {
  std::string (*arc_type)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  uint64_t (*_properties)(struct __pyx_obj_9pywrapfst_EncodeMapper *, uint64_t);
  std::string (*weight_type)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  void (*write)(struct __pyx_obj_9pywrapfst_EncodeMapper *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*write_to_string)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *(*input_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *(*output_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch);
  void (*_set_input_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst_SymbolTableView *);
  void (*_set_output_symbols)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst_SymbolTableView *);
};
static struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *__pyx_vtabptr_9pywrapfst_EncodeMapper;


/* "pywrapfst.pyx":1714
 * 
 * 
 * cdef class Fst:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

struct __pyx_vtabstruct_9pywrapfst_Fst {
  std::string (*_server_render_svg)(std::string const &);
  std::string (*_local_render_svg)(std::string const &);
  std::string (*arc_type)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__ArcIterator *(*arcs)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, 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_3Fst_draw *__pyx_optional_args);
  struct __pyx_obj_9pywrapfst_Weight *(*final)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch);
  std::string (*fst_type)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__FstSymbolTableView *(*input_symbols)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  size_t (*num_arcs)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch);
  size_t (*num_input_epsilons)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch);
  size_t (*num_output_epsilons)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch);
  struct __pyx_obj_9pywrapfst__FstSymbolTableView *(*output_symbols)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
  std::string (*print)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_print *__pyx_optional_args);
  uint64_t (*_properties)(struct __pyx_obj_9pywrapfst_Fst *, uint64_t, bool);
  int64_t (*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);
  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);
  PyObject *(*write_to_string)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst_Fst *__pyx_vtabptr_9pywrapfst_Fst;


/* "pywrapfst.pyx":2242
 * 
 * 
 * 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 *, int64_t, struct __pyx_obj_9pywrapfst_Arc *);
  int64_t (*add_state)(struct __pyx_obj_9pywrapfst_MutableFst *, int __pyx_skip_dispatch);
  void (*add_states)(struct __pyx_obj_9pywrapfst_MutableFst *, size_t, int __pyx_skip_dispatch);
  void (*_arcsort)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args);
  void (*_closure)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__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 *, int64_t, struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_arcs *__pyx_optional_args);
  void (*_delete_states)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__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_10MutableFst__minimize *__pyx_optional_args);
  struct __pyx_obj_9pywrapfst__MutableArcIterator *(*mutable_arcs)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t, int __pyx_skip_dispatch);
  int64_t (*num_states)(struct __pyx_obj_9pywrapfst_MutableFst *, int __pyx_skip_dispatch);
  void (*_project)(struct __pyx_obj_9pywrapfst_MutableFst *, PyObject *);
  void (*_prune)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__prune *__pyx_optional_args);
  void (*_push)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__push *__pyx_optional_args);
  void (*_relabel_pairs)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args);
  void (*_relabel_tables)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args);
  void (*_reserve_arcs)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t, size_t);
  void (*_reserve_states)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t);
  void (*_reweight)(struct __pyx_obj_9pywrapfst_MutableFst *, PyObject *, struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight *__pyx_optional_args);
  void (*_rmepsilon)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args);
  void (*_set_final)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t, struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final *__pyx_optional_args);
  void (*_set_start)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t);
  void (*_set_input_symbols)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_SymbolTableView *);
  void (*_set_output_symbols)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_SymbolTableView *);
  void (*_topsort)(struct __pyx_obj_9pywrapfst_MutableFst *);
};
static struct __pyx_vtabstruct_9pywrapfst_MutableFst *__pyx_vtabptr_9pywrapfst_MutableFst;


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

struct __pyx_vtabstruct_9pywrapfst_VectorFst {
  struct __pyx_vtabstruct_9pywrapfst_MutableFst __pyx_base;
};
static struct __pyx_vtabstruct_9pywrapfst_VectorFst *__pyx_vtabptr_9pywrapfst_VectorFst;


/* "pywrapfst.pyx":3383
 * 
 * 
 * cdef class Arc:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

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":3453
 * 
 * 
 * cdef class _ArcIterator:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

struct __pyx_vtabstruct_9pywrapfst__ArcIterator {
  bool (*done)(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);
  struct __pyx_obj_9pywrapfst_Arc *(*_value)(struct __pyx_obj_9pywrapfst__ArcIterator *);
};
static struct __pyx_vtabstruct_9pywrapfst__ArcIterator *__pyx_vtabptr_9pywrapfst__ArcIterator;


/* "pywrapfst.pyx":3591
 * 
 * 
 * cdef class _MutableArcIterator:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator {
  struct __pyx_vtabstruct_9pywrapfst__ArcIterator __pyx_base;
  void (*set_value)(struct __pyx_obj_9pywrapfst__MutableArcIterator *, struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator *__pyx_vtabptr_9pywrapfst__MutableArcIterator;


/* "pywrapfst.pyx":3754
 * 
 * 
 * cdef class _StateIterator:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

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);
  int64_t (*_value)(struct __pyx_obj_9pywrapfst__StateIterator *);
  int64_t (*value)(struct __pyx_obj_9pywrapfst__StateIterator *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_9pywrapfst__StateIterator *__pyx_vtabptr_9pywrapfst__StateIterator;


/* "pywrapfst.pyx":4712
 * 
 * 
 * cdef class Compiler:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

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":4844
 * 
 * 
 * cdef class FarReader:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

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":5010
 * 
 * 
 * cdef class FarWriter:             # <<<<<<<<<<<<<<
 * 
 *   """
*/

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;
/* #### Code section: utility_code_proto ### */

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

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

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

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

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

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

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

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

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

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

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

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

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

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

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

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

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

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

/* PyObject_Unicode.proto */
#define __Pyx_PyObject_Unicode(obj)\
    (likely(PyUnicode_CheckExact(obj)) ? __Pyx_NewRef(obj) : PyObject_Str(obj))

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

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

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

/* fastcall.proto */
#if CYTHON_AVOID_BORROWED_REFS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
#elif CYTHON_ASSUME_SAFE_MACROS
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
#else
    #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
#endif
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
    #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  #else
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  #endif
#else
    #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
#else
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

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

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

/* CallCFunction.proto */
#define __Pyx_CallCFunction(cfunc, self, args)\
    ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
#define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
    ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
#define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
    ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
#define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
    ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
    __pyx_atomic_int_type initialized;
#endif
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
#if !CYTHON_ATOMICS
    return 1;
#else
    __pyx_nonatomic_int_type expected = 0;
    if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
        return 0;
    }
    return expected;
#endif
}
static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
#if CYTHON_ATOMICS
    __pyx_atomic_store(&cfunc->initialized, 2);
#endif
}
#else
#define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
#define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
#endif

/* CallUnboundCMethod2.proto */
CYTHON_UNUSED
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

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

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

/* RejectKeywords.proto */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds);

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

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

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

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

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

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely(__Pyx_IS_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);

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

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

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

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

/* MoveIfSupported.proto */
#if CYTHON_USE_CPP_STD_MOVE
  #include <utility>
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) std::move(x)
#else
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) x
#endif

/* PyObjectDelAttr.proto */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
#define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
#else
#define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
#endif

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

/* PyObjectVectorCallKwBuilder.proto */
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#if CYTHON_VECTORCALL
#if PY_VERSION_HEX >= 0x03090000
#define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
#endif
#define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
#else
#define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
#define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
#define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
#define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
#endif

/* PyObjectFastCallMethod.proto */
#if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
#define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
#else
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
#endif

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

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

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

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

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

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

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

/* DefaultPlacementNew.proto */
#include <new>
template<typename T>
void __Pyx_default_placement_construct(T* x) {
    new (static_cast<void*>(x)) T();
}

/* CallTypeTraverse.proto */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
#endif

/* FixUpExtensionType.proto */
static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);

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

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

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

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

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

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

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

/* MergeVTables.proto */
static int __Pyx_MergeVtables(PyTypeObject *type);

/* LimitedApiGetTypeDict.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
#endif

/* DelItemOnTypeDict.proto */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k);
#define __Pyx_DelItemOnTypeDict(tp, k) __Pyx__DelItemOnTypeDict((PyTypeObject*)tp, k)

/* SetItemOnTypeDict.proto */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
#define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)

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

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

/* ImportDottedModule.proto */
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple);

/* ListPack.proto */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...);

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

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

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

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

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

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

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

/* dict_setdefault.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);

/* PyMethodNew.proto */
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);

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

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_CyFunction_GetClassObj(f)\
      (((__pyx_CyFunctionObject *) (f))->func_classobj)
#else
  #define __Pyx_CyFunction_GetClassObj(f)\
      ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
#endif
#define __Pyx_CyFunction_SetClassObj(f, classobj)\
    __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject_HEAD
    PyObject *func;
#elif PY_VERSION_HEX < 0x030900B1
    PyCFunctionObject func;
#else
    PyCMethodObject func;
#endif
#if CYTHON_BACKPORT_VECTORCALL ||\
        (CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL)
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    PyObject *func_classobj;
#endif
    PyObject *defaults;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#undef __Pyx_CyOrPyCFunction_Check
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
#define __Pyx_CyOrPyCFunction_Check(obj)  __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
#undef __Pyx_IsSameCFunction
#define __Pyx_IsSameCFunction(func, cfunc)   __Pyx__IsSameCyOrCFunction(func, cfunc)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
                                                         PyTypeObject *defaults_type);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(PyObject *module);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
#endif
#endif

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

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

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

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

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

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

/* UnpackTuple2.proto */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
    PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple);
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

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

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

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

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

/* CodeObjectCache.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject __Pyx_CachedCodeObjectType;
#else
typedef PyCodeObject __Pyx_CachedCodeObjectType;
#endif
typedef struct {
    __Pyx_CachedCodeObjectType* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_int_type accessor_count;
  #endif
};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);

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

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

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

/* LengthHint.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_PyObject_LengthHint(o, defaultval)  (defaultval)
#else
#define __Pyx_PyObject_LengthHint(o, defaultval)  PyObject_LengthHint(o, defaultval)
#endif

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

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

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

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

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

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

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

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

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

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

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

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
#define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
#else
static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
#endif
#else  // !LIMITED_API
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

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

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

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
    return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
}
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
#ifdef PyExceptionInstance_Check
  #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
#else
  #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
#endif

/* GetRuntimeVersion.proto */
static unsigned long __Pyx_get_runtime_version(void);

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

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

/* MultiPhaseInitModuleState.proto */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
static PyObject *__Pyx_State_FindModule(void*);
static int __Pyx_State_AddModule(PyObject* module, void*);
static int __Pyx_State_RemoveModule(void*);
#elif CYTHON_USE_MODULE_STATE
#define __Pyx_State_FindModule PyState_FindModule
#define __Pyx_State_AddModule PyState_AddModule
#define __Pyx_State_RemoveModule PyState_RemoveModule
#endif

/* #### Code section: module_declarations ### */
/* CythonABIVersion.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
    #if CYTHON_METH_FASTCALL
        #define __PYX_FASTCALL_ABI_SUFFIX  "_fastcall"
    #else
        #define __PYX_FASTCALL_ABI_SUFFIX
    #endif
    #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#else
    #define __PYX_LIMITED_ABI_SUFFIX
#endif
#if __PYX_HAS_PY_AM_SEND == 1
    #define __PYX_AM_SEND_ABI_SUFFIX
#elif __PYX_HAS_PY_AM_SEND == 2
    #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
#else
    #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
#endif
#ifndef __PYX_MONITORING_ABI_SUFFIX
    #define __PYX_MONITORING_ABI_SUFFIX
#endif
#if CYTHON_USE_TP_FINALIZE
    #define __PYX_TP_FINALIZE_ABI_SUFFIX
#else
    #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
#endif
#if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
    #define __PYX_FREELISTS_ABI_SUFFIX
#else
    #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
#endif
#define CYTHON_ABI  __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."

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_type(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 bool __pyx_f_9pywrapfst_6Weight_member(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_15SymbolTableView__raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_15SymbolTableView__raise_nonexistent(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_15SymbolTableView__raw_ptr_or_raise(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto*/
static int64_t __pyx_f_9pywrapfst_15SymbolTableView_available_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_15SymbolTableView_copy(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static int64_t __pyx_f_9pywrapfst_15SymbolTableView_get_nth_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_15SymbolTableView_member(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_15SymbolTableView_name(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_15SymbolTableView_num_symbols(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_15SymbolTableView_write(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_write_to_string(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_28_EncodeMapperSymbolTableView__raw(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_19_FstSymbolTableView__raw(struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__raw(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw_ptr_or_raise(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self); /* proto*/
static int64_t __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_SymbolTableView *__pyx_v_symbols, 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 __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_26_MutableFstSymbolTableView__mutable_raw(struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self); /* proto*/
static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_11SymbolTable__mutable_raw(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self); /* proto*/
static std::string __pyx_f_9pywrapfst_12EncodeMapper_arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, 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 uint64_t __pyx_f_9pywrapfst_12EncodeMapper__properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, uint64_t __pyx_v_mask); /* proto*/
static void __pyx_f_9pywrapfst_12EncodeMapper_write(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9pywrapfst_12EncodeMapper_write_to_string(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, 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_SymbolTableView *__pyx_v_symbols); /* proto*/
static void __pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst__server_render_svg(std::string const &__pyx_v_dot); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst__local_render_svg(std::string const &__pyx_v_dot); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst_arc_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_f_9pywrapfst_3Fst_arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst_3Fst_copy(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_3Fst_draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_draw *__pyx_optional_args); /* proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_3Fst_final(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst_fst_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst_3Fst_input_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_input_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_output_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst_3Fst_output_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst_print(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_print *__pyx_optional_args); /* proto*/
static uint64_t __pyx_f_9pywrapfst_3Fst__properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, uint64_t __pyx_v_mask, bool __pyx_v_test); /* proto*/
static int64_t __pyx_f_9pywrapfst_3Fst_start(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst__StateIterator *__pyx_f_9pywrapfst_3Fst_states(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static bool __pyx_f_9pywrapfst_3Fst_verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static std::string __pyx_f_9pywrapfst_3Fst_weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_3Fst_write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_9pywrapfst_3Fst_write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__check_mutating_imethod(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__add_arc(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto*/
static int64_t __pyx_f_9pywrapfst_10MutableFst_add_state(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst_add_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__arcsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__closure(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__closure *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__concat(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst2); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__connect(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__decode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__delete_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_arcs *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__delete_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_states *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__encode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__invert(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__minimize(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize *__pyx_optional_args); /* proto*/
static struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_f_9pywrapfst_10MutableFst_mutable_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch); /* proto*/
static int64_t __pyx_f_9pywrapfst_10MutableFst_num_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__prune(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__prune *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__push(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__push *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__relabel_pairs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__reserve_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, size_t __pyx_v_n); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__reserve_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_n); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__reweight(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__rmepsilon(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__set_final(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final *__pyx_optional_args); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__set_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__set_start(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state); /* proto*/
static void __pyx_f_9pywrapfst_10MutableFst__topsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* 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_12_ArcIterator_done(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_12_ArcIterator_next(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_12_ArcIterator_position(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_12_ArcIterator_reset(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_12_ArcIterator_seek(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, size_t __pyx_v_a, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_12_ArcIterator__value(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto*/
static bool __pyx_f_9pywrapfst_19_MutableArcIterator_done(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_19_MutableArcIterator_next(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static size_t __pyx_f_9pywrapfst_19_MutableArcIterator_position(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_19_MutableArcIterator_reset(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_19_MutableArcIterator_seek(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, size_t __pyx_v_a, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_19_MutableArcIterator_set_value(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_19_MutableArcIterator__value(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto*/
static bool __pyx_f_9pywrapfst_14_StateIterator_done(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_14_StateIterator_next(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_9pywrapfst_14_StateIterator_reset(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static int64_t __pyx_f_9pywrapfst_14_StateIterator__value(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto*/
static int64_t __pyx_f_9pywrapfst_14_StateIterator_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.stdint" */

/* Module declarations from "libcpp" */

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

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

/* Module declarations from "libcpp.string_view" */

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

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

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

/* Module declarations from "cios" */

/* Module declarations from "libcpp.optional" */

/* Module declarations from "cpywrapfst" */

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

/* Module declarations from "libcpp.limits" */

/* Module declarations from "cmemory" */

/* Module declarations from "pywrapfst" */
static std::string __pyx_f_9pywrapfst_tostring(PyObject *); /*proto*/
static std::string __pyx_f_9pywrapfst_weight_tostring(PyObject *); /*proto*/
static std::string __pyx_f_9pywrapfst_path_tostring(PyObject *); /*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 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__no_weight(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__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(std::shared_ptr<fst::script::EncodeMapperClass> , bool); /*proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst__init_FstSymbolTableView(std::shared_ptr<fst::script::FstClass> , bool); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(std::shared_ptr<fst::script::MutableFstClass> , bool); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__init_SymbolTable(std::unique_ptr<fst::SymbolTable> ); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__read_SymbolTable_from_string(std::string, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_t_9pywrapfst_EncodeMapperClass_ptr); /*proto*/
static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__read_EncodeMapper_from_string(std::string, int __pyx_skip_dispatch); /*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_Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst_from_string(std::string, 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 void __pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst_Fst *, std::vector<fst::script::WeightClass>  *, 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 fst::FarType __pyx_f_9pywrapfst__get_far_type(std::string const &); /*proto*/
static enum fst::ClosureType __pyx_f_9pywrapfst__get_closure_type(std::string const &); /*proto*/
static enum fst::EpsNormalizeType __pyx_f_9pywrapfst__get_eps_norm_type(std::string const &); /*proto*/
static fst::ProjectType __pyx_f_9pywrapfst__get_project_type(std::string const &); /*proto*/
static enum fst::ReweightType __pyx_f_9pywrapfst__get_reweight_type(std::string const &); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_compact_symbol_table(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_merge_symbol_table(struct __pyx_obj_9pywrapfst_SymbolTableView *, struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch); /*proto*/
static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &); /*proto*/
static std::vector<std::string>  __pyx_convert_vector_from_py_std_3a__3a_string(PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "pywrapfst"
extern int __pyx_module_is_main_pywrapfst;
int __pyx_module_is_main_pywrapfst = 0;

/* Implementation of "pywrapfst" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_ImportError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_IOError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_id;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_KeyError;
/* #### Code section: string_decls ### */
static const char __pyx_k_[] = ": ";
static const char __pyx_k_1[] = "\200!\360\"\000\005\t\210\t\220\021\220'\230\021\330\004\013\2101";
static const char __pyx_k_4[] = "\200!\360\014\000\005\014\2104\320\017!\240\022\240=\260\001";
static const char __pyx_k_5[] = "\200!\360\016\000\005\014\2105\220\001\220\021";
static const char __pyx_k_Q[] = "\200\001\330\004\n\210+\220Q";
static const char __pyx_k_a[] = "a";
static const char __pyx_k_e[] = "e";
static const char __pyx_k_g[] = "g";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_w[] = "w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_4q[] = "\200!\360\016\000\005\014\2104\210q\220\001";
static const char __pyx_k_Bj[] = "\200!\360\022\000\n\013\330\006\n\210&\220\004\220B\220j\240\001\240\021";
static const char __pyx_k_D0[] = "\200!\330\004\014\320\014,\250D\3200@\300\001";
static const char __pyx_k_Qa[] = "\200!\360\016\000\005\014\210:\220Q\220a";
static const char __pyx_k__2[] = "<";
static const char __pyx_k__3[] = ">";
static const char __pyx_k__4[] = "\t ";
static const char __pyx_k__6[] = "";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_id[] = "id";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_1_2[] = "\320\002!\240\021\360&\000\005\t\210\t\220\021\220!\330\004\013\2101";
static const char __pyx_k_1_3[] = "\200!\360\"\000\005\t\210\010\220\001\220\021\330\004\013\2101";
static const char __pyx_k_1_4[] = "\200!\360\030\000\005\t\210\t\220\021\330\004\013\2101";
static const char __pyx_k_1_5[] = "\200!\360\034\000\005\t\210\010\220\001\220\021\330\004\013\2101";
static const char __pyx_k_1_6[] = "\200!\360&\000\005\t\210\010\220\001\220\021\330\004\013\2101";
static const char __pyx_k_1_7[] = "\200!\360\030\000\005\t\210\010\220\001\330\004\013\2101";
static const char __pyx_k_1_8[] = "\200!\360\"\000\005\t\210\t\220\021\220!\330\004\013\2101";
static const char __pyx_k_1_9[] = "\200!\360\030\000\005\t\320\010\030\230\001\230\021\330\004\013\2101";
static const char __pyx_k_4_5[] = "\200!\360\014\000\005\014\2104\320\017!\240\022\2405\250\001";
static const char __pyx_k_4_a[] = "\200!\360\014\000\005\014\2104\320\017!\240\022\240;\250a";
static const char __pyx_k_9AQ[] = "\200!\360 \000\005\014\2109\220A\220Q";
static const char __pyx_k_Arc[] = "Arc";
static const char __pyx_k_BfA[] = "\200!\360\014\000\005\t\210\010\220\004\220B\220f\230A";
static const char __pyx_k_Fst[] = "Fst";
static const char __pyx_k__40[] = ".";
static const char __pyx_k__41[] = "?";
static const char __pyx_k__42[] = "\200!\360 \000\005\014\320\013)\250\021\250!";
static const char __pyx_k__43[] = "\200!\360 \000\005\014\320\013 \240\001\240\021";
static const char __pyx_k__44[] = "\200!\360\022\000\005\014\210>\230\021\230!";
static const char __pyx_k_a_1[] = "\320\002\036\230a\360&\000\005\t\210\t\220\021\220!\330\004\013\2101";
static const char __pyx_k_a_2[] = "\200!\360\020\000\005\033\230$\230a\330\004\013\210=\230\001\230\024\230\\\250\021\250!";
static const char __pyx_k_a_3[] = "\200!\360\020\000\005\033\230$\230a\330\004\013\210=\230\001\230\024\230\\\250\021\250'\260\021";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_arc[] = "arc";
static const char __pyx_k_avQ[] = "\200!\360\030\000\005\014\320\013\036\230a\230v\240Q";
static const char __pyx_k_b_Q[] = "\200!\360\014\000\n\013\330\006\n\210(\220$\220b\230\005\230Q";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_d2B[] = "\200!\330\006\r\320\r.\250d\3202B\300!";
static const char __pyx_k_d_E[] = "\200!\360\014\000\n\013\330\006\n\210$\210d\220\"\220E\230\021";
static const char __pyx_k_d_F[] = "\200!\360\014\000\n\013\330\006\n\210$\210d\220\"\220F\230!";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dot[] = "dot";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lhs[] = "lhs";
static const char __pyx_k_one[] = "one";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = "pos";
static const char __pyx_k_ptr[] = "ptr";
static const char __pyx_k_q_1[] = "\320\002!\240\021\360 \000\005\t\210\017\220q\230\001\330\004\013\2101";
static const char __pyx_k_q_a[] = "\200!\360\030\000\005\014\210<\220q\230\006\230a";
static const char __pyx_k_q_d[] = "\200!\360\022\000\n\013\330\006\020\220\007\220q\230\006\230d\240!";
static const char __pyx_k_raw[] = "_raw";
static const char __pyx_k_rhs[] = "rhs";
static const char __pyx_k_sep[] = "sep";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_t2U[] = "\200!\360\014\000\n\013\330\006\n\210%\210t\2202\220U\230!";
static const char __pyx_k_1A_1[] = "\200!\360\034\000\005\t\320\010\033\2301\230A\330\004\013\2101";
static const char __pyx_k_1L_1[] = "\200!\330\033\034\330\035\036\330\027\030\330\"#\330\037 \360,\000\005\t\210\013\2201\220L\240\t\250\030\260\030\270\021\330\004\013\2101";
static const char __pyx_k_1_10[] = "\200!\360\032\000\005\t\210\t\220\021\330\004\013\2101";
static const char __pyx_k_4_31[] = "\200!\360\014\000\005\014\2104\320\017!\240\022\320#3\2601";
static const char __pyx_k_4_7q[] = "\200!\330\004\013\320\013#\2404\320'7\260q";
static const char __pyx_k_4_9A[] = "\200!\360\014\000\005\014\2104\320\017!\240\022\2409\250A";
static const char __pyx_k_4_Qa[] = "\200!\360\030\000\005\014\2104\320\017!\240\022\240:\250Q\250a";
static const char __pyx_k_AQ_1[] = "\200!\360\034\000\005\t\320\010\034\230A\230Q\330\004\013\2101";
static const char __pyx_k_Call[] = "Call";
static const char __pyx_k_Flag[] = "Flag";
static const char __pyx_k_HD_1[] = "\200!\360\016\000\n\013\330\006\020\220\004\220H\230D\240\002\240(\250!\330\004\013\2101";
static const char __pyx_k_PATH[] = "PATH";
static const char __pyx_k_PIPE[] = "PIPE";
static const char __pyx_k_arcs[] = "arcs";
static const char __pyx_k_as_q[] = "\200\001\360\"\000\003\031\230\006\230a\230s\240!\330\002\t\210\036\220q\330\002\t\210\021";
static const char __pyx_k_auto[] = "auto";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_done[] = "done";
static const char __pyx_k_draw[] = "draw";
static const char __pyx_k_enum[] = "enum";
static const char __pyx_k_find[] = "find";
static const char __pyx_k_fst2[] = "fst2";
static const char __pyx_k_func[] = "__func__";
static const char __pyx_k_hd_E[] = "\200!\330\t\n\330\006\020\320\020!\240\021\240$\240h\250d\260\"\260E\270\021";
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_push[] = "push";
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_self[] = "self";
static const char __pyx_k_spec[] = "__spec__";
static const char __pyx_k_star[] = "star";
static const char __pyx_k_t2V1[] = "\200!\360\014\000\n\013\330\006\n\210%\210t\2202\220V\2301";
static const char __pyx_k_test[] = "test";
static const char __pyx_k_tfar[] = "_tfar";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_zero[] = "zero";
static const char __pyx_k_4xt2U[] = "\200!\360\n\000\005\014\2104\210x\220t\2302\230U\240!";
static const char __pyx_k_ERROR[] = "ERROR";
static const char __pyx_k_F_b_1[] = "\200!\360\016\000\n\013\330\006\020\220\004\220F\230$\230b\240\n\250!\330\004\013\2101";
static const char __pyx_k_Popen[] = "Popen";
static const char __pyx_k_Q_avT[] = "\200!\360\014\000\005\014\210:\220Q\320\026&\240a\240v\250T\260\021";
static const char __pyx_k_Qe1_q[] = "\200\001\360(\000\003\031\230\005\230Q\230e\2401\330\002\t\210\036\220q\330\002\t\210\021";
static const char __pyx_k_Qiy_a[] = "\200\001\360.\000\003\n\210\024\210Q\210i\220y\240\n\250$\250a";
static const char __pyx_k_T_RuA[] = "\200!\360\022\000\n\013\330\006\r\210T\220\030\230\024\230R\230u\240A";
static const char __pyx_k_T_RvQ[] = "\200!\360\022\000\n\013\330\006\r\210T\220\030\230\024\230R\230v\240Q";
static const char __pyx_k_T_Rwa[] = "\200!\360\022\000\n\013\330\006\r\210T\220\030\230\024\230R\230w\240a";
static const char __pyx_k_T_Rxq[] = "\200!\360\014\000\n\013\330\006\r\210T\220\030\230\024\230R\230x\240q";
static const char __pyx_k_T_T_5[] = "\200!\360\022\000\n\013\330\006\r\210T\220\024\220T\230\022\2305\240\001";
static const char __pyx_k_T_d_E[] = "\200!\360\022\000\n\013\330\006\r\210T\220\025\220d\230\"\230E\240\021";
static const char __pyx_k_T_d_F[] = "\200!\360\014\000\n\013\330\006\r\210T\220\025\220d\230\"\230F\240!";
static const char __pyx_k_a_q_1[] = "\320\002!\240\035\250a\360(\000\005\t\210\017\220q\230\010\240\001\330\004\013\2101";
static const char __pyx_k_at_0x[] = " at 0x";
static const char __pyx_k_auA_q[] = "\200\001\360(\000\003\031\230\006\230a\230u\240A\330\002\t\210\036\220q\330\002\t\210\021";
static const char __pyx_k_awa_1[] = "\200!\360 \000\005\t\210\016\220a\220w\230a\330\004\013\2101";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_d_E_2[] = "\200!\360\022\000\n\013\330\006\n\210$\210d\220\"\220E\230\021\230!";
static const char __pyx_k_delta[] = "delta";
static const char __pyx_k_equal[] = "equal";
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_fsts2[] = "fsts2";
static const char __pyx_k_graph[] = "graph";
static const char __pyx_k_ifst1[] = "ifst1";
static const char __pyx_k_ifst2[] = "ifst2";
static const char __pyx_k_input[] = "input";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_npath[] = "npath";
static const char __pyx_k_pairs[] = "pairs";
static const char __pyx_k_power[] = "power";
static const char __pyx_k_print[] = "print";
static const char __pyx_k_props[] = "props";
static const char __pyx_k_prune[] = "prune";
static const char __pyx_k_q_Q_q[] = "\200\001\360,\000\003\031\230\007\230q\240\005\240Q\330\002\t\210\036\220q\330\002\t\210\021";
static const char __pyx_k_q_q_1[] = "\320\002/\250q\360.\000\005\t\210\n\220!\220<\230q\330\004\013\2101";
static const char __pyx_k_reset[] = "reset";
static const char __pyx_k_sep_2[] = "_sep";
static const char __pyx_k_sstrm[] = "_sstrm";
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_t2U_1[] = "\200!\360\022\000\n\013\330\006\n\210%\210t\2202\220U\230!\2301";
static const char __pyx_k_times[] = "times";
static const char __pyx_k_title[] = "title";
static const char __pyx_k_union[] = "union";
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_1A_1_2[] = "\200!\360\036\000\005\t\210\013\2201\220A\330\004\013\2101";
static const char __pyx_k_4xt2V1[] = "\200!\360\022\000\005\014\2104\210x\220t\2302\230V\2401";
static const char __pyx_k_4xt2WA[] = "\200!\330\004\013\2104\210x\220t\2302\230W\240A";
static const char __pyx_k_4xt2Ya[] = "\200!\330\004\013\2104\210x\220t\2302\230Y\240a";
static const char __pyx_k_CYCLIC[] = "CYCLIC";
static const char __pyx_k_HD_Q_1[] = "\200!\360\016\000\n\013\330\006\020\220\004\220H\230D\240\002\240+\250Q\330\004\013\2101";
static const char __pyx_k_Number[] = "Number";
static const char __pyx_k_STRING[] = "STRING";
static const char __pyx_k_T_d_Kq[] = "\200!\360\022\000\n\013\330\006\r\210T\220\025\220d\230\"\230K\240q";
static const char __pyx_k_Weight[] = " Weight ";
static const char __pyx_k_arcmap[] = "arcmap";
static const char __pyx_k_concat[] = "concat";
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_enable[] = "enable";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_failed[] = " failed";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_fspath[] = "fspath";
static const char __pyx_k_fst2_2[] = "_fst2";
static const char __pyx_k_hd_E_2[] = "\200!\360\014\000\n\013\330\006\020\320\020!\240\021\240$\240h\250d\260\"\260E\270\021";
static const char __pyx_k_height[] = "height";
static const char __pyx_k_ilabel[] = "ilabel";
static const char __pyx_k_invert[] = "invert";
static const char __pyx_k_ipairs[] = "ipairs";
static const char __pyx_k_mapper[] = "mapper";
static const char __pyx_k_mask_2[] = "_mask";
static const char __pyx_k_member[] = "member";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "name";
static const char __pyx_k_nstate[] = "nstate";
static const char __pyx_k_olabel[] = "olabel";
static const char __pyx_k_opairs[] = "opairs";
static const char __pyx_k_q_xq_1[] = "\200!\330\033\034\330\036\037\330\023\024\360(\000\005\t\210\007\210q\220\007\220x\230q\330\004\013\2101";
static const char __pyx_k_reader[] = "reader";
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_source[] = "source";
static const char __pyx_k_states[] = "states";
static const char __pyx_k_stdout[] = "stdout";
static const char __pyx_k_stubby[] = "stubby";
static const char __pyx_k_symbol[] = "symbol";
static const char __pyx_k_test_2[] = "__test__";
static const char __pyx_k_typing[] = "typing";
static const char __pyx_k_unique[] = "unique";
static const char __pyx_k_vector[] = "vector";
static const char __pyx_k_verify[] = "verify";
static const char __pyx_k_weight[] = "weight";
static const char __pyx_k_writer[] = "writer";
static const char __pyx_k_0_QgQ_1[] = "\320\0020\260\001\360$\000\005\t\210\r\220Q\220g\230Q\330\004\013\2101";
static const char __pyx_k_1_k_XV5[] = "\320\000\025\320\025;\2701\360*\000\010\t\330\004\016\210k\230\021\230&\240\005\240X\250V\2605\270\010\300\001";
static const char __pyx_k_ACYCLIC[] = "ACYCLIC";
static const char __pyx_k_AZq_b_Q[] = "\200!\360\014\000\005\014\320\013\034\230A\230Z\240q\250\004\320,>\270b\300\005\300Q";
static const char __pyx_k_A_1G1_1[] = "\320\002,\250A\360$\000\005\t\210\013\2201\220G\2301\330\004\013\2101";
static const char __pyx_k_E_Rxq_1[] = "\200!\360\016\000\n\013\330\006\020\220\004\220E\230\024\230R\230x\240q\330\004\013\2101";
static const char __pyx_k_FarType[] = "FarType";
static const char __pyx_k_Gq4_7_1[] = "\320\002$\320$G\300q\3604\000\005\t\210\n\220!\2207\230!\330\004\013\2101";
static const char __pyx_k_IOError[] = "IOError";
static const char __pyx_k_MUTABLE[] = "MUTABLE";
static const char __pyx_k_add_arc[] = "add_arc";
static const char __pyx_k_arcsort[] = "arcsort";
static const char __pyx_k_class_2[] = "_class__";
static const char __pyx_k_closure[] = "closure";
static const char __pyx_k_compile[] = "compile";
static const char __pyx_k_compose[] = "compose";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_convert[] = "convert";
static const char __pyx_k_default[] = "default";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_flags_2[] = "_flags";
static const char __pyx_k_fsts2_2[] = "_fsts2";
static const char __pyx_k_get_fst[] = "get_fst";
static const char __pyx_k_get_key[] = "get_key";
static const char __pyx_k_logging[] = "logging";
static const char __pyx_k_members[] = "__members__";
static const char __pyx_k_neither[] = "neither";
static const char __pyx_k_nodesep[] = "nodesep";
static const char __pyx_k_numbers[] = "numbers";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_project[] = "project";
static const char __pyx_k_props_2[] = "_props";
static const char __pyx_k_randgen[] = "randgen";
static const char __pyx_k_ranksep[] = "ranksep";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_reverse[] = "reverse";
static const char __pyx_k_sources[] = "sources";
static const char __pyx_k_symbols[] = "symbols";
static const char __pyx_k_t6_Ry_1[] = "\200!\360\024\000\n\013\330\006\017\210t\2206\230\024\230R\230y\250\001\330\004\013\2101";
static const char __pyx_k_topsort[] = "topsort";
static const char __pyx_k_uniform[] = "uniform";
static const char __pyx_k_warning[] = "warning";
static const char __pyx_k_3at9D_Yd[] = "\200!\330\004\013\2103\210a\210t\2209\230D\240\t\250\024\250Y\260d\270!";
static const char __pyx_k_4_aw_1_1[] = "\200!\330\032\033\330$%\330\031\032\3604\000\005\t\210\006\210a\210w\320\026+\2501\330\004\013\2101";
static const char __pyx_k_86_QfD_1[] = "\200!\360\014\000\005\033\230&\240\010\250\001\250\021\330\004\013\2108\2206\230\021\320\032-\250Q\250f\260D\270\001\330\004\013\2101";
static const char __pyx_k_ACCEPTOR[] = "ACCEPTOR";
static const char __pyx_k_Arc_copy[] = "Arc.copy";
static const char __pyx_k_Compiler[] = "Compiler";
static const char __pyx_k_EPSILONS[] = "EPSILONS";
static const char __pyx_k_EXPANDED[] = "EXPANDED";
static const char __pyx_k_Expected[] = "Expected ";
static const char __pyx_k_Fa_HAQ_1[] = "\200!\330\004(\250\004\320,F\300a\330\004\034\230H\240A\240Q\330\t\n\330\006\022\220(\230!\2301";
static const char __pyx_k_FstError[] = "FstError";
static const char __pyx_k_Fst_arcs[] = "Fst.arcs";
static const char __pyx_k_Fst_copy[] = "Fst.copy";
static const char __pyx_k_Fst_draw[] = "Fst.draw";
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_P_QfG_WA[] = "\200\001\330 !\330\032\033\330\036\037\330\030\031\360P\001\000\003\n\210\024\210Q\210f\220G\230:\240W\250A";
static const char __pyx_k_SEMIRING[] = "SEMIRING";
static const char __pyx_k_SortType[] = "SortType";
static const char __pyx_k_T_T_9A_1[] = "\200!\360\024\000\n\013\330\006\r\210T\220\024\220T\230\022\2309\240A\330\004\013\2101";
static const char __pyx_k_T_d_IQ_1[] = "\200!\360\024\000\n\013\330\006\r\210T\220\025\220d\230\"\230I\240Q\330\004\013\2101";
static const char __pyx_k_WEIGHTED[] = "WEIGHTED";
static const char __pyx_k_Weight_2[] = "Weight";
static const char __pyx_k_acceptor[] = "acceptor";
static const char __pyx_k_add_note[] = "add_note";
static const char __pyx_k_arc_type[] = "arc_type";
static const char __pyx_k_checksum[] = "checksum";
static const char __pyx_k_d_b_1_1A[] = "\200!\360\022\000\n\013\330\005\016\210d\220(\230$\230b\240\013\2501\330\004\013\320\013\033\2301\230A";
static const char __pyx_k_det_type[] = "det_type";
static const char __pyx_k_distance[] = "_distance";
static const char __pyx_k_far_type[] = "far_type";
static const char __pyx_k_fontsize[] = "fontsize";
static const char __pyx_k_frontend[] = "frontend";
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_mapper_2[] = "_mapper";
static const char __pyx_k_minimize[] = "minimize";
static const char __pyx_k_new_name[] = "new_name";
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_q_w_9AV1[] = "\200!\360\030\000\005\"\240\024\320%?\270q\330\004'\240w\320.@\300\001\330\t\n\330\006\013\2109\220A\220V\2301";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_read_Fst[] = "_read_Fst";
static const char __pyx_k_read_fst[] = "read_fst";
static const char __pyx_k_repr_svg[] = "_repr_svg_";
static const char __pyx_k_result_2[] = "result";
static const char __pyx_k_reweight[] = "reweight";
static const char __pyx_k_set_name[] = "set_name";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_source_2[] = "_source";
static const char __pyx_k_ssymbols[] = "ssymbols";
static const char __pyx_k_standard[] = "standard";
static const char __pyx_k_statemap[] = "statemap";
static const char __pyx_k_tropical[] = "tropical";
static const char __pyx_k_vertical[] = "vertical";
static const char __pyx_k_weight_2[] = "_weight";
static const char __pyx_k_weighted[] = "weighted";
static const char __pyx_k_ARC_FLAGS[] = "ARC_FLAGS";
static const char __pyx_k_Arc_at_0x[] = "<Arc at 0x";
static const char __pyx_k_FarReader[] = "FarReader";
static const char __pyx_k_FarWriter[] = "FarWriter";
static const char __pyx_k_Fst_at_0x[] = " Fst at 0x";
static const char __pyx_k_Fst_final[] = "Fst.final";
static const char __pyx_k_Fst_print[] = "Fst.print";
static const char __pyx_k_Fst_start[] = "Fst.start";
static const char __pyx_k_Fst_write[] = "Fst.write";
static const char __pyx_k_NO_SYMBOL[] = "NO_SYMBOL";
static const char __pyx_k_QueueType[] = "QueueType";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_VectorFst[] = "VectorFst";
static const char __pyx_k_add_state[] = "add_state";
static const char __pyx_k_add_table[] = "add_table";
static const char __pyx_k_intersect[] = "intersect";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_nextstate[] = "nextstate";
static const char __pyx_k_no_weight[] = "no_weight";
static const char __pyx_k_nshortest[] = "nshortest";
static const char __pyx_k_precision[] = "precision";
static const char __pyx_k_pywrapfst[] = "<pywrapfst>";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_read_text[] = "read_text";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_rmepsilon[] = "rmepsilon";
static const char __pyx_k_set_final[] = "set_final";
static const char __pyx_k_set_flags[] = "set_flags";
static const char __pyx_k_set_start[] = "set_start";
static const char __pyx_k_set_value[] = "set_value";
static const char __pyx_k_sort_type[] = "sort_type";
static const char __pyx_k_sources_2[] = "_sources";
static const char __pyx_k_symbols_2[] = "_symbols";
static const char __pyx_k_t4t2V1_1A[] = "\200!\360\024\000\n\013\330\006\017\210t\2204\220t\2302\230V\2401\330\004\013\320\013\033\2301\230A";
static const char __pyx_k_t5_BfA_1A[] = "\200!\360\024\000\n\013\330\006\017\210t\2205\230\004\230B\230f\240A\330\004\013\320\013\033\2301\230A";
static const char __pyx_k_t84r_q_AQ[] = "\200!\360\024\000\n\013\330\006\017\210t\2208\2304\230r\240\026\240q\330\004\013\320\013\034\230A\230Q";
static const char __pyx_k_to_string[] = "to_string";
static const char __pyx_k_xq_T_RuAQ[] = "\200!\360\032\000\005\030\220x\230q\240\001\330\t\n\330\006\r\210T\220\030\230\024\230R\230u\240A\240Q";
static const char __pyx_k_7_A_6_q_4q[] = "\200\001\360\030\000\003$\2407\320*<\270A\340\007\010\330\004\013\2106\220\024\320\025(\250\001\250\026\250q\330\002\t\320\t\032\230!\2304\230q\240\001";
static const char __pyx_k_ACCESSIBLE[] = "ACCESSIBLE";
static const char __pyx_k_ArcMapType[] = "ArcMapType";
static const char __pyx_k_FstIOError[] = "FstIOError";
static const char __pyx_k_FstOpError[] = "FstOpError";
static const char __pyx_k_Fst_states[] = "Fst.states";
static const char __pyx_k_Fst_verify[] = "Fst.verify";
static const char __pyx_k_IDEMPOTENT[] = "IDEMPOTENT";
static const char __pyx_k_I_EPSILONS[] = "I_EPSILONS";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_MutableFst[] = "MutableFst";
static const char __pyx_k_NOT_STRING[] = "NOT_STRING";
static const char __pyx_k_O_EPSILONS[] = "O_EPSILONS";
static const char __pyx_k_TOP_SORTED[] = "TOP_SORTED";
static const char __pyx_k_Tsvg_cairo[] = "-Tsvg:cairo";
static const char __pyx_k_UNWEIGHTED[] = "UNWEIGHTED";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_WeightLike[] = "WeightLike";
static const char __pyx_k_Weight_one[] = "Weight.one";
static const char __pyx_k_add_states[] = "add_states";
static const char __pyx_k_add_symbol[] = "add_symbol";
static const char __pyx_k_arc_type_2[] = "_arc_type";
static const char __pyx_k_colabtools[] = "colabtools";
static const char __pyx_k_difference[] = "difference";
static const char __pyx_k_equivalent[] = "equivalent";
static const char __pyx_k_expression[] = "expression";
static const char __pyx_k_far_type_2[] = "_far_type";
static const char __pyx_k_functional[] = "functional";
static const char __pyx_k_isomorphic[] = "isomorphic";
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_q_Q_d_IQha[] = "\200!\360\024\000\005\033\230%\230q\330\004\031\230\024\230Q\330\t\n\330\006\n\210$\210d\220\"\220I\230Q\230h\240a";
static const char __pyx_k_q_Q_t2Yaxq[] = "\200!\360\024\000\005\033\230%\230q\330\004\031\230\024\230Q\330\t\n\330\006\n\210%\210t\2202\220Y\230a\230x\240q";
static const char __pyx_k_queue_type[] = "queue_type";
static const char __pyx_k_set_name_2[] = "__set_name__";
static const char __pyx_k_subprocess[] = "subprocess";
static const char __pyx_k_t5_Bm3c_1D[] = "\200!\360\014\000\005\010\200t\2105\220\004\220B\220m\2403\240c\250\021\330\006\007\330\004\013\320\013#\2401\240D\320(:\270!";
static const char __pyx_k_t5_BnCs_1D[] = "\200!\360\014\000\005\010\200t\2105\220\004\220B\220n\240C\240s\250!\330\006\007\330\004\013\320\013#\2401\240D\320(:\270!";
static const char __pyx_k_t5_Jaq_4wa[] = "\200!\360\030\000\005\010\200t\2105\220\001\330\006\014\210J\220a\220q\330\004\013\2104\210w\220a";
static const char __pyx_k_to_initial[] = "to_initial";
static const char __pyx_k_write_text[] = "write_text";
static const char __pyx_k_5_a_BnAXQ_1[] = "\200!\360\034\000\005\034\2305\240\001\330\004\032\230$\230a\330\t\n\330\006\n\210&\220\004\220B\220n\240A\240X\250Q\330\004\013\2101";
static const char __pyx_k_6a_fAV5_e81[] = "\320\000\020\320\0206\260a\360$\000\010\t\330\004\016\210f\220A\220V\2305\240\010\250\006\250e\2608\2701";
static const char __pyx_k_ArcIterator[] = "_ArcIterator";
static const char __pyx_k_COMMUTATIVE[] = "COMMUTATIVE";
static const char __pyx_k_ClosureType[] = "ClosureType";
static const char __pyx_k_FstArgError[] = "FstArgError";
static const char __pyx_k_ImportError[] = "ImportError";
static const char __pyx_k_NO_EPSILONS[] = "NO_EPSILONS";
static const char __pyx_k_NO_STATE_ID[] = "NO_STATE_ID";
static const char __pyx_k_Open_failed[] = "Open failed: ";
static const char __pyx_k_ProjectType[] = "ProjectType";
static const char __pyx_k_Read_failed[] = "Read failed: ";
static const char __pyx_k_SymbolTable[] = "<SymbolTable ";
static const char __pyx_k_Weight_copy[] = "Weight.copy";
static const char __pyx_k_Weight_type[] = "Weight.type";
static const char __pyx_k_Weight_zero[] = "Weight.zero";
static const char __pyx_k_communicate[] = "communicate";
static const char __pyx_k_delete_arcs[] = "delete_arcs";
static const char __pyx_k_determinize[] = "determinize";
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_mro_entries[] = "__mro_entries__";
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_synchronize[] = "synchronize";
static const char __pyx_k_t6_R_3c_4_B[] = "\200!\360\014\000\005\010\200t\2106\220\024\220R\320\027+\2503\250c\260\021\330\006\007\330\004\013\320\013*\250!\2504\320/B\300!";
static const char __pyx_k_t6_R_Cs_4_B[] = "\200!\360\014\000\005\010\200t\2106\220\024\220R\320\027,\250C\250s\260!\330\006\007\330\004\013\320\013*\250!\2504\320/B\300!";
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_DisplayToast[] = "DisplayToast";
static const char __pyx_k_ENCODE_FLAGS[] = "ENCODE_FLAGS";
static const char __pyx_k_EncodeMapper[] = "EncodeMapper";
static const char __pyx_k_Fst___reduce[] = "Fst.__reduce__";
static const char __pyx_k_Fst_arc_type[] = "Fst.arc_type";
static const char __pyx_k_Fst_fst_type[] = "Fst.fst_type";
static const char __pyx_k_Fst_num_arcs[] = "Fst.num_arcs";
static const char __pyx_k_NOT_ACCEPTOR[] = "NOT_ACCEPTOR";
static const char __pyx_k_ReweightType[] = "ReweightType";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_StateMapType[] = "StateMapType";
static const char __pyx_k_Write_failed[] = "Write failed: ";
static const char __pyx_k_allow_nondet[] = "allow_nondet";
static const char __pyx_k_but_received[] = " but received ";
static const char __pyx_k_closure_type[] = "closure_type";
static const char __pyx_k_disambiguate[] = "disambiguate";
static const char __pyx_k_epsnormalize[] = "epsnormalize";
static const char __pyx_k_float_format[] = "float_format";
static const char __pyx_k_hd_L_Q_j_V4q[] = "\200!\360\034\000\014\r\330\010\022\220$\220h\230d\240\"\240L\260\001\260\030\270\021\330\006\t\210\024\210Q\330\010\016\210j\230\001\230\021\330\006\r\210V\2204\220q";
static const char __pyx_k_initializing[] = "_initializing";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
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_project_type[] = "project_type";
static const char __pyx_k_push_weights[] = "push_weights";
static const char __pyx_k_reserve_arcs[] = "reserve_arcs";
static const char __pyx_k_return_bytes[] = "return_bytes";
static const char __pyx_k_return_label[] = "return_label";
static const char __pyx_k_shortestpath[] = "shortestpath";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_stringsource[] = "<stringsource>";
static const char __pyx_k_2323_2323_D_1[] = "\200!\33023\33023\330%&\330./\33023\33023\330%&\330./\360D\001\000\005\t\320\010\030\230\001\230\021\330\031\032\330\031\032\330\031\032\330\031\032\330\031\032\330\031\032\330\031\032\330\004\013\2101";
static const char __pyx_k_6_6_XT_q_Qe81[] = "\200!\360\024\000\n\013\330\006\013\2106\220\021\320\022\"\240!\2406\250\024\250X\260T\270\022\270<\300q\330\004\013\210:\220Q\220e\2308\2401";
static const char __pyx_k_ComposeFilter[] = "ComposeFilter";
static const char __pyx_k_Conversion_to[] = "Conversion to ";
static const char __pyx_k_ENCODE_LABELS[] = "ENCODE_LABELS";
static const char __pyx_k_FarWriter_add[] = "FarWriter.add";
static const char __pyx_k_FstIndexError[] = "FstIndexError";
static const char __pyx_k_FstProperties[] = "FstProperties";
static const char __pyx_k_Fst__repr_svg[] = "Fst._repr_svg_";
static const char __pyx_k_LEFT_SEMIRING[] = "LEFT_SEMIRING";
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_RenderRequest[] = "RenderRequest";
static const char __pyx_k_StateIterator[] = "_StateIterator";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_SymbolTable_2[] = "SymbolTable";
static const char __pyx_k_Weight_member[] = "Weight.member";
static const char __pyx_k_available_key[] = "available_key";
static const char __pyx_k_delete_states[] = "delete_states";
static const char __pyx_k_encode_labels[] = "encode_labels";
static const char __pyx_k_eps_norm_type[] = "eps_norm_type";
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_relabel_pairs[] = "relabel_pairs";
static const char __pyx_k_reweight_type[] = "reweight_type";
static const char __pyx_k_t4t2U_Jaq_4wa[] = "\200!\360\030\000\005\010\200t\2104\210t\2202\220U\230!\330\006\014\210J\220a\220q\330\004\013\2104\210w\220a";
static const char __pyx_k_t5_Jaq_t2YavS[] = "\200!\360\030\000\005\010\200t\2105\220\001\330\006\014\210J\220a\220q\330\t\n\330\006\n\210%\210t\2202\220Y\230a\230v\240S\250\001";
static const char __pyx_k_Compiler_write[] = "Compiler.write";
static const char __pyx_k_ENCODE_WEIGHTS[] = "ENCODE_WEIGHTS";
static const char __pyx_k_FST_PROPERTIES[] = "FST_PROPERTIES";
static const char __pyx_k_FarReader_done[] = "FarReader.done";
static const char __pyx_k_FarReader_find[] = "FarReader.find";
static const char __pyx_k_FarReader_next[] = "FarReader.next";
static const char __pyx_k_FarReader_open[] = "FarReader.open";
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_JauE_Q_q_F_d_1[] = "\200!\360$\000\005\t\210\t\220\021\330\006\014\210J\220a\220u\230E\240\024\240Q\330\t\n\330\t\017\210q\220\004\220F\230$\230d\240!\330\004\010\320\010 \240\001\330\004\013\2101";
static const char __pyx_k_M_hd_F_1_Q_j_Q[] = "\200!\360\032\000\007\035\230M\250\021\250!\340\013\014\330\010\022\220$\220h\230d\240\"\240F\250!\2501\330\006\t\210\024\210Q\330\010\016\210j\230\001\230\022\320\033-\250Q";
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_RIGHT_SEMIRING[] = "RIGHT_SEMIRING";
static const char __pyx_k_compose_filter[] = "compose_filter";
static const char __pyx_k_d_A_T_axq_T_Qa[] = "\200!\360 \000\005'\240d\320*<\270A\330\004\005\330\006\r\210T\220\035\230a\230x\240q\250\001\330\013\014\330\006\r\210T\220\034\230Q\230a";
static const char __pyx_k_d_t2_q_v_d_M_1[] = "\200!\360 \000\n\013\330\006\016\210d\220%\220t\2302\320\035/\250q\260\001\330\004\007\200v\320\r&\240d\250!\330\006\014\210M\230\021\230!\330\004\013\2101";
static const char __pyx_k_encode_weights[] = "encode_weights";
static const char __pyx_k_output_symbols[] = "output_symbols";
static const char __pyx_k_randequivalent[] = "randequivalent";
static const char __pyx_k_relabel_tables[] = "relabel_tables";
static const char __pyx_k_rendered_bytes[] = "rendered_bytes";
static const char __pyx_k_rendered_graph[] = "rendered_graph";
static const char __pyx_k_reserve_states[] = "reserve_states";
static const char __pyx_k_set_properties[] = "set_properties";
static const char __pyx_k_t84r_c_A_AT1Fa[] = "\200!\360\014\000\005\010\200t\2108\2204\220r\230\035\240c\250\023\250A\330\006\007\330\004\013\320\013,\250A\250T\3201F\300a";
static const char __pyx_k_t84r_s_Q_AT1Fa[] = "\200!\360\014\000\005\010\200t\2108\2204\220r\230\036\240s\250#\250Q\330\006\007\330\004\013\320\013,\250A\250T\3201F\300a";
static const char __pyx_k_1_QfE_uA_U_Q_AQ[] = "\320\000\025\320\025;\2701\360*\000\003\023\220!\340\007\010\330\004\022\220+\230Q\230f\240E\250\030\260\026\260u\270A\330\036%\240U\250!\330\002\005\200Q\330\004\n\210*\220A\220Q\330\002\t\210\021";
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_D_T_3DA_6_vV_XQ[] = "\200!\360\014\000\005%\240D\250\005\250T\260\022\3203D\300A\330\004\013\2106\220\026\220v\230V\240:\250X\260Q";
static const char __pyx_k_DeterminizeType[] = "DeterminizeType";
static const char __pyx_k_DrawFloatFormat[] = "DrawFloatFormat";
static const char __pyx_k_FarReader_at_0x[] = " FarReader at 0x";
static const char __pyx_k_FarReader_error[] = "FarReader.error";
static const char __pyx_k_FarReader_reset[] = "FarReader.reset";
static const char __pyx_k_FarWriter_at_0x[] = " FarWriter at 0x";
static const char __pyx_k_FarWriter_error[] = "FarWriter.error";
static const char __pyx_k_Fst_weight_type[] = "Fst.weight_type";
static const char __pyx_k_INITIAL_ACYCLIC[] = "INITIAL_ACYCLIC";
static const char __pyx_k_I_DETERMINISTIC[] = "I_DETERMINISTIC";
static const char __pyx_k_MutableFst_push[] = "MutableFst.push";
static const char __pyx_k_NULL_PROPERTIES[] = "NULL_PROPERTIES";
static const char __pyx_k_O_DETERMINISTIC[] = "O_DETERMINISTIC";
static const char __pyx_k_SymbolTableView[] = "SymbolTableView";
static const char __pyx_k_WEIGHTED_CYCLES[] = "WEIGHTED_CYCLES";
static const char __pyx_k_d_A_T_1HAQ_T_AQ[] = "\200!\360\"\000\005'\240d\320*<\270A\330\004\005\330\006\r\210T\220\032\2301\230H\240A\240Q\330\013\014\330\006\r\210T\220\033\230A\230Q";
static const char __pyx_k_d_t2XQa_v_d_M_1[] = "\200!\360 \000\n\013\330\006\016\210d\220%\220t\2302\230X\240Q\240a\330\004\007\200v\320\r&\240d\250!\330\006\014\210M\230\021\230!\330\004\013\2101";
static const char __pyx_k_d_t2_aq_v_d_M_1[] = "\200!\360 \000\n\013\330\006\016\210d\220%\220t\2302\320\035.\250a\250q\330\004\007\200v\320\r&\240d\250!\330\006\014\210M\230\021\230!\330\004\013\2101";
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_ArcIteratorFlags[] = "ArcIteratorFlags";
static const char __pyx_k_ArcIterator_done[] = "_ArcIterator.done";
static const char __pyx_k_ArcIterator_next[] = "_ArcIterator.next";
static const char __pyx_k_ArcIterator_seek[] = "_ArcIterator.seek";
static const char __pyx_k_Cannot_construct[] = "Cannot construct ";
static const char __pyx_k_Compiler_compile[] = "Compiler.compile";
static const char __pyx_k_EpsNormalizeType[] = "EpsNormalizeType";
static const char __pyx_k_FarWriter_create[] = "FarWriter.create";
static const char __pyx_k_MutableFst_prune[] = "MutableFst.prune";
static const char __pyx_k_MutableFst_union[] = "MutableFst.union";
static const char __pyx_k_NOT_COACCESSIBLE[] = "NOT_COACCESSIBLE";
static const char __pyx_k_Operation_failed[] = "Operation failed";
static const char __pyx_k_RandArcSelection[] = "RandArcSelection";
static const char __pyx_k_ReplaceLabelType[] = "ReplaceLabelType";
static const char __pyx_k_SymbolTable_read[] = "SymbolTable.read";
static const char __pyx_k_T_1_6_t1_Jaq_6_Q[] = "\200!\360\032\000\005&\240T\320);\2701\340\t\n\330\006\020\220\003\2206\230\021\230!\330\004\007\200t\2101\330\006\014\210J\220a\220q\330\004\013\2106\220\024\220Q";
static const char __pyx_k_T_1_q_6_t1_Jar_1[] = "\200!\360\034\000\005&\240T\320);\2701\330\004\032\230-\240q\250\001\340\t\n\330\006\020\220\003\2206\230\021\230!\330\004\007\200t\2101\330\006\014\210J\220a\220r\320\031+\2501";
static const char __pyx_k_Unknown_FAR_type[] = "Unknown FAR type: ";
static const char __pyx_k_Unknown_arc_type[] = "Unknown arc type: ";
static const char __pyx_k_Unknown_map_type[] = "Unknown map type: ";
static const char __pyx_k_WeightProperties[] = "WeightProperties";
static const char __pyx_k_Weight_no_weight[] = "Weight.no_weight";
static const char __pyx_k_Weight_to_string[] = "Weight.to_string";
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_vQ_AT_1F_he4q_xq[] = "\200\001\360(\000\003\010\200v\210Q\320\016$\240A\240T\250\031\260!\330\007\010\330\007\023\2201\220F\230$\230h\240e\2504\250q\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_8_Fa_1_t6_Zq_Zq_1[] = "\320\0028\270\001\360\"\000\005)\250\004\320,F\300a\330\004\032\230(\240!\2401\340\004\007\200t\2106\220\021\330\013\014\330\010\021\220\034\230Z\240q\250\t\260\021\340\013\014\330\010\021\220\034\230Z\240q\250\001\330\004\013\2101";
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_A_1HA_U_c_A_AQ_1E[] = "\200\001\340\002\t\210\023\210A\340\007\010\330\004\030\230\013\2401\240H\250A\330\002\005\200U\210$\210c\220\023\220A\330\004\n\210*\220A\220Q\330\002\t\210\032\2201\220E\230\030\240\021";
static const char __pyx_k_ArcIterator_at_0x[] = "<_ArcIterator at 0x";
static const char __pyx_k_ArcIterator_flags[] = "_ArcIterator.flags";
static const char __pyx_k_ArcIterator_reset[] = "_ArcIterator.reset";
static const char __pyx_k_ArcIterator_value[] = "_ArcIterator.value";
static const char __pyx_k_BINARY_PROPERTIES[] = "BINARY_PROPERTIES";
static const char __pyx_k_EncodeMapperFlags[] = "EncodeMapperFlags";
static const char __pyx_k_EncodeMapper_read[] = "EncodeMapper.read";
static const char __pyx_k_FarReader_get_fst[] = "FarReader.get_fst";
static const char __pyx_k_FarReader_get_key[] = "FarReader.get_key";
static const char __pyx_k_FstBadWeightError[] = "FstBadWeightError";
static const char __pyx_k_Fst_input_symbols[] = "Fst.input_symbols";
static const char __pyx_k_Literal_star_plus[] = "Literal[\"star\", \"plus\"]";
static const char __pyx_k_MutableFst_concat[] = "MutableFst.concat";
static const char __pyx_k_MutableFst_decode[] = "MutableFst.decode";
static const char __pyx_k_MutableFst_encode[] = "MutableFst.encode";
static const char __pyx_k_MutableFst_invert[] = "MutableFst.invert";
static const char __pyx_k_Qa_Qa_U_c_A_AR_1E[] = "\200\001\330\002\030\230\r\240Q\240a\340\007\010\330\004\030\230\005\230Q\230a\330\002\005\200U\210$\210c\220\023\220A\330\004\n\210*\220A\220R\320\027(\250\001\330\002\t\210\032\2201\220E\230\030\240\021";
static const char __pyx_k_UNWEIGHTED_CYCLES[] = "UNWEIGHTED_CYCLES";
static const char __pyx_k_Unknown_sort_type[] = "Unknown sort type: ";
static const char __pyx_k_Weight_properties[] = "Weight.properties";
static const char __pyx_k_call_arc_labeling[] = "call_arc_labeling";
static const char __pyx_k_q_E_RvQa_t1_Jar_1[] = "\200!\360\034\000\005\033\230-\240q\250\001\340\t\n\330\006\020\220\004\220E\230\024\230R\230v\240Q\240a\330\004\007\200t\2101\330\006\014\210J\220a\220r\320\031+\2501";
static const char __pyx_k_q_f_E_xt3c_Jar_AT[] = "\200!\360 \000\005\033\230-\240q\250\001\330\t\n\330\006\016\210f\320\024$\240E\250\021\250!\330\004\007\200x\210t\2203\220c\230\021\330\006\014\210J\220a\220r\320\031*\250!\330\004\013\320\013\034\230A\230T\240\021\240!";
static const char __pyx_k_set_input_symbols[] = "set_input_symbols";
static const char __pyx_k_t5_c_U_s_Q_7_1_is[] = "\200!\360 \000\005\031\230\010\240\001\240\021\330\004\007\200t\2105\220\006\220c\230\024\230U\240%\240s\250#\250Q\330\006\013\2107\220!\2201\330\004\n\210$\210i\220s\230!";
static const char __pyx_k_86_Qd_t2V1A_t7_M_1[] = "\200!\360\036\000\005\033\230&\240\010\250\001\250\021\330\004\013\2108\2206\230\021\320\032-\250Q\250d\260%\260t\2702\270V\3001\300A\330\004\007\200t\2107\220'\230\021\330\006\014\210M\230\021\230!\330\004\013\2101";
static const char __pyx_k_ADD_ARC_PROPERTIES[] = "ADD_ARC_PROPERTIES";
static const char __pyx_k_Compilation_failed[] = "Compilation failed";
static const char __pyx_k_E_RvQha_t1_Jaq_6_Q[] = "\200!\360\034\000\n\013\330\006\020\220\004\220E\230\024\230R\230v\240Q\240h\250a\330\004\007\200t\2101\330\006\014\210J\220a\220q\330\004\013\2106\220\024\220Q";
static const char __pyx_k_EncodeMapper_at_0x[] = "<EncodeMapper at 0x";
static const char __pyx_k_EncodeMapper_flags[] = "EncodeMapper.flags";
static const char __pyx_k_EncodeMapper_write[] = "EncodeMapper.write";
static const char __pyx_k_FarReader_arc_type[] = "FarReader.arc_type";
static const char __pyx_k_FarReader_far_type[] = "FarReader.far_type";
static const char __pyx_k_FarWriter_arc_type[] = "FarWriter.arc_type";
static const char __pyx_k_FarWriter_far_type[] = "FarWriter.far_type";
static const char __pyx_k_FstSymbolTableView[] = "_FstSymbolTableView";
static const char __pyx_k_Fst_output_symbols[] = "Fst.output_symbols";
static const char __pyx_k_MutableArcIterator[] = "_MutableArcIterator";
static const char __pyx_k_MutableFst_add_arc[] = "MutableFst.add_arc";
static const char __pyx_k_MutableFst_arcsort[] = "MutableFst.arcsort";
static const char __pyx_k_MutableFst_closure[] = "MutableFst.closure";
static const char __pyx_k_MutableFst_connect[] = "MutableFst.connect";
static const char __pyx_k_MutableFst_project[] = "MutableFst.project";
static const char __pyx_k_MutableFst_topsort[] = "MutableFst.topsort";
static const char __pyx_k_MutableSymbolTable[] = "_MutableSymbolTable";
static const char __pyx_k_NOT_I_LABEL_SORTED[] = "NOT_I_LABEL_SORTED";
static const char __pyx_k_NOT_O_LABEL_SORTED[] = "NOT_O_LABEL_SORTED";
static const char __pyx_k_Q_vQ_AT_q_d_t4q_xq[] = "\320\000=\270Q\360(\000\003\010\200v\210Q\320\016$\240A\240T\250\031\260!\330\007\010\330\007\017\210q\220\006\220d\230(\240%\240t\2504\250q\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_SET_ARC_PROPERTIES[] = "SET_ARC_PROPERTIES";
static const char __pyx_k_StateIterator_done[] = "_StateIterator.done";
static const char __pyx_k_StateIterator_next[] = "_StateIterator.next";
static const char __pyx_k_TRINARY_PROPERTIES[] = "TRINARY_PROPERTIES";
static const char __pyx_k_Unknown_queue_type[] = "Unknown queue type: ";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
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_merge_symbol_table[] = "merge_symbol_table";
static const char __pyx_k_num_input_epsilons[] = "num_input_epsilons";
static const char __pyx_k_set_output_symbols[] = "set_output_symbols";
static const char __pyx_k_xq_HD_avV4q_t1_Jaq[] = "\200!\360$\000\005\030\220x\230q\240\001\340\t\n\330\006\020\220\004\220H\230D\240\002\240$\240a\240v\250V\2604\260q\330\004\007\200t\2101\330\006\014\210J\220a\220q";
static const char __pyx_k_8_1F_7_a_U_b_4vYa_j[] = "\200\001\330$%\330'(\330\025\026\330\025\026\3608\000\003\024\2201\220F\230%\230|\2507\260(\270,\300a\330\002\t\210\021\210&\220\001\220\024\220U\230$\230b\240\013\2504\250v\260Y\270a\330\n\016\210j\230\001";
static const char __pyx_k_ARC_SORT_PROPERTIES[] = "ARC_SORT_PROPERTIES";
static const char __pyx_k_A_F_Qha_XT_Cq_AQ_4q[] = "\200\001\340\002\t\210\023\210A\340\007\010\330\004\014\210F\320\022\"\240+\250Q\250h\260a\330\002\005\200X\210T\220\023\220C\220q\330\004\n\210*\220A\220Q\330\002\t\320\t\032\230!\2304\230q\240\001";
static const char __pyx_k_A_axq_WD_3a_AQ_1G81[] = "\200\001\340\002\t\210\023\210A\340\007\010\330\004#\240;\250a\250x\260q\330\002\005\200W\210D\220\003\2203\220a\330\004\n\210*\220A\220Q\330\002\t\320\t\033\2301\230G\2408\2501";
static const char __pyx_k_Arc___reduce_cython[] = "Arc.__reduce_cython__";
static const char __pyx_k_Fst_SymbolTableView[] = "<Fst SymbolTableView ";
static const char __pyx_k_Fst_write_to_string[] = "Fst.write_to_string";
static const char __pyx_k_MutableFst_minimize[] = "MutableFst.minimize";
static const char __pyx_k_MutableFst_reweight[] = "MutableFst.reweight";
static const char __pyx_k_NON_I_DETERMINISTIC[] = "NON_I_DETERMINISTIC";
static const char __pyx_k_NON_O_DETERMINISTIC[] = "NON_O_DETERMINISTIC";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_RenderServer_Render[] = "RenderServer.Render";
static const char __pyx_k_StateIterator_at_0x[] = "<_StateIterator at 0x";
static const char __pyx_k_StateIterator_reset[] = "_StateIterator.reset";
static const char __pyx_k_StateIterator_value[] = "_StateIterator.value";
static const char __pyx_k_SymbolTableIterator[] = "_SymbolTableIterator";
static const char __pyx_k_attach_new_isymbols[] = "attach_new_isymbols";
static const char __pyx_k_attach_new_osymbols[] = "attach_new_osymbols";
static const char __pyx_k_graphviz_server_pb2[] = "graphviz_server_pb2";
static const char __pyx_k_num_output_epsilons[] = "num_output_epsilons";
static const char __pyx_k_num_states_if_known[] = "num_states_if_known";
static const char __pyx_k_q_U_1_wd_S_Jar_QgXQ[] = "\200!\360 \000\005\033\230-\240q\250\001\340\t\n\330\006%\240U\250!\2501\330\004\007\200w\210d\220#\220S\230\001\330\006\014\210J\220a\220r\320\031*\250!\330\004\013\320\013\035\230Q\230g\240X\250Q";
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_s_A_s_A_6_avZvZq_4q[] = "\200\001\360.\000\003(\240s\320*<\270A\330\002'\240s\320*<\270A\340\007\010\330\004\013\2106\220\024\320\025&\240a\240v\250Z\260v\270Z\300q\330\002\t\320\t\032\230!\2304\230q\240\001";
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_ArcIterator_position[] = "_ArcIterator.position";
static const char __pyx_k_EXTRINSIC_PROPERTIES[] = "EXTRINSIC_PROPERTIES";
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_MutableFst_add_state[] = "MutableFst.add_state";
static const char __pyx_k_MutableFst_rmepsilon[] = "MutableFst.rmepsilon";
static const char __pyx_k_MutableFst_set_final[] = "MutableFst.set_final";
static const char __pyx_k_MutableFst_set_start[] = "MutableFst.set_start";
static const char __pyx_k_Q_1_xq_d_U_c_A_AR_1E[] = "\320\000%\240Q\360\"\000\003\033\230(\240!\2401\340\007\010\330\004\017\210x\220q\230\006\230d\240(\250!\340\002\005\200U\210$\210c\220\023\220A\330\004\n\210*\220A\220R\320\027)\250\021\330\002\t\210\032\2201\220E\230\030\240\021";
static const char __pyx_k_Read_from_FST_failed[] = "Read from FST failed: ";
static const char __pyx_k_SET_FINAL_PROPERTIES[] = "SET_FINAL_PROPERTIES";
static const char __pyx_k_SET_START_PROPERTIES[] = "SET_START_PROPERTIES";
static const char __pyx_k_SymbolTableView_copy[] = "SymbolTableView.copy";
static const char __pyx_k_SymbolTableView_find[] = "SymbolTableView.find";
static const char __pyx_k_SymbolTableView_name[] = "SymbolTableView.name";
static const char __pyx_k_SymbolTable_read_fst[] = "SymbolTable.read_fst";
static const char __pyx_k_compact_symbol_table[] = "compact_symbol_table";
static const char __pyx_k_keep_state_numbering[] = "keep_state_numbering";
static const char __pyx_k_read_Fst_from_string[] = "_read_Fst_from_string";
static const char __pyx_k_require_superinitial[] = "require_superinitial";
static const char __pyx_k_typing_Literal_e_f_g[] = "typing.Literal[\"e\", \"f\", \"g\"]";
static const char __pyx_k_ArcIterator_set_flags[] = "_ArcIterator.set_flags";
static const char __pyx_k_Arc___setstate_cython[] = "Arc.__setstate_cython__";
static const char __pyx_k_DELETE_ARC_PROPERTIES[] = "DELETE_ARC_PROPERTIES";
static const char __pyx_k_EncodeMapper___reduce[] = "EncodeMapper.__reduce__";
static const char __pyx_k_EncodeMapper_arc_type[] = "EncodeMapper.arc_type";
static const char __pyx_k_MutableFst_add_states[] = "MutableFst.add_states";
static const char __pyx_k_MutableFst_num_states[] = "MutableFst.num_states";
static const char __pyx_k_STATE_SORT_PROPERTIES[] = "STATE_SORT_PROPERTIES";
static const char __pyx_k_SymbolTableView_write[] = "SymbolTableView.write";
static const char __pyx_k_SymbolTable_read_text[] = "SymbolTable.read_text";
static const char __pyx_k_Unknown_reweight_type[] = "Unknown reweight type: ";
static const char __pyx_k_Weight_type_not_found[] = "Weight type not found";
static const char __pyx_k_blade_graphviz_server[] = "blade:graphviz-server";
static const char __pyx_k_mutable_input_symbols[] = "mutable_input_symbols";
static const char __pyx_k_q_fD_q_xt3c_Jar_31_AT[] = "\200!\360,\000\005\033\230-\240q\250\001\330\t\n\330\006\016\210f\220D\230\017\240q\250\t\260\021\330\004\007\200x\210t\2203\220c\230\021\330\006\014\210J\220a\220r\320\0313\2601\330\004\013\320\013\034\230A\230T\240\021\240!";
static const char __pyx_k_Dot_rendering_failed_s[] = "Dot rendering failed: %s";
static const char __pyx_k_Fst_num_input_epsilons[] = "Fst.num_input_epsilons";
static const char __pyx_k_MutableFst_delete_arcs[] = "MutableFst.delete_arcs";
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_SymbolTableView_member[] = "SymbolTableView.member";
static const char __pyx_k_Weight___reduce_cython[] = "Weight.__reduce_cython__";
static const char __pyx_k_Write_to_string_failed[] = "Write to string failed";
static const char __pyx_k_mutable_output_symbols[] = "mutable_output_symbols";
static const char __pyx_k_vQ_AT_9_l_QfD_T_Yha_xq[] = "\200\001\330&'\330)*\330\036\037\360,\000\003\010\200v\210Q\320\016$\240A\240T\250\031\260!\330\002!\320!9\270\021\270$\270l\310!\330:;\330\007\010\330\007\r\210Q\210f\220D\230\010\240\005\240T\250\024\250Y\260h\270a\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_DELETE_STATE_PROPERTIES[] = "DELETE_STATE_PROPERTIES";
static const char __pyx_k_EncodeMapper_properties[] = "EncodeMapper.properties";
static const char __pyx_k_Fst_num_output_epsilons[] = "Fst.num_output_epsilons";
static const char __pyx_k_Fst_num_states_if_known[] = "Fst.num_states_if_known";
static const char __pyx_k_MutableArcIterator_done[] = "_MutableArcIterator.done";
static const char __pyx_k_MutableArcIterator_next[] = "_MutableArcIterator.next";
static const char __pyx_k_MutableArcIterator_seek[] = "_MutableArcIterator.seek";
static const char __pyx_k_MutableFst_mutable_arcs[] = "MutableFst.mutable_arcs";
static const char __pyx_k_MutableFst_reserve_arcs[] = "MutableFst.reserve_arcs";
static const char __pyx_k_Read_from_string_failed[] = "Read from string failed";
static const char __pyx_k_Unknown_projection_type[] = "Unknown projection type: ";
static const char __pyx_k_a_T_1_q_xq_Qiq_t1_Jar_1[] = "\320\002&\240a\360 \000\005&\240T\320);\2701\330\004\032\230-\240q\250\001\330\004\027\220x\230q\240\001\340\t\n\330\006\020\220\003\220:\230Q\230i\240q\330\004\007\200t\2101\330\006\014\210J\220a\220r\320\031+\2501";
static const char __pyx_k_q_xq_f_IQiq_xt3c_Jar_AT[] = "\200!\330$%\360\"\000\005\033\230-\240q\250\001\330\004\027\220x\230q\240\001\330\t\n\330\006\016\210f\320\024$\240I\250Q\250i\260q\330\004\007\200x\210t\2203\220c\230\021\330\006\014\210J\220a\220r\320\031*\250!\330\004\013\320\013\034\230A\230T\240\021\240!";
static const char __pyx_k_Compiler___reduce_cython[] = "Compiler.__reduce_cython__";
static const char __pyx_k_EncodeMapper_weight_type[] = "EncodeMapper.weight_type";
static const char __pyx_k_MutableArcIterator_at_0x[] = "<_MutableArcIterator at 0x";
static const char __pyx_k_MutableArcIterator_flags[] = "_MutableArcIterator.flags";
static const char __pyx_k_MutableArcIterator_reset[] = "_MutableArcIterator.reset";
static const char __pyx_k_MutableArcIterator_value[] = "_MutableArcIterator.value";
static const char __pyx_k_MutableFst_delete_states[] = "MutableFst.delete_states";
static const char __pyx_k_MutableFst_relabel_pairs[] = "MutableFst.relabel_pairs";
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_SymbolTableView___reduce[] = "SymbolTableView.__reduce__";
static const char __pyx_k_SymbolTableView_checksum[] = "SymbolTableView.checksum";
static const char __pyx_k_Weight___setstate_cython[] = "Weight.__setstate_cython__";
static const char __pyx_k_6a_vQ_AT_6axq_AV4xuD_A_xq[] = "\320\0006\260a\360,\000\003\010\200v\210Q\320\016$\240A\240T\250\031\260!\330\002$\320$6\260a\260x\270q\300\001\330\007\010\330\007\024\220A\220V\2304\230x\240u\250D\260\004\260A\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_ADD_SUPERFINAL_PROPERTIES[] = "ADD_SUPERFINAL_PROPERTIES";
static const char __pyx_k_Cannot_topsort_cyclic_FST[] = "Cannot topsort cyclic FST";
static const char __pyx_k_FarReader___reduce_cython[] = "FarReader.__reduce_cython__";
static const char __pyx_k_FarWriter___reduce_cython[] = "FarWriter.__reduce_cython__";
static const char __pyx_k_MutableFstSymbolTableView[] = "_MutableFstSymbolTableView";
static const char __pyx_k_MutableFst_relabel_tables[] = "MutableFst.relabel_tables";
static const char __pyx_k_MutableFst_reserve_states[] = "MutableFst.reserve_states";
static const char __pyx_k_MutableFst_set_properties[] = "MutableFst.set_properties";
static const char __pyx_k_SymbolTableIterator_at_0x[] = "<_SymbolTableIterator at 0x";
static const char __pyx_k_const_Fst_SymbolTableView[] = "<const Fst SymbolTableView ";
static const char __pyx_k_1M_j_Qa_uD_3a_Jar_IXQa_T_1[] = "\200!\360&\000\005$\2401\240M\260\021\260(\270$\270j\310\001\340\t\n\330\006 \240\005\240Q\240a\330\004\007\200u\210D\220\003\2203\220a\330\006\014\210J\220a\220r\320\031*\250!\330\004\034\230I\240X\250Q\250a\330\004\n\210+\220T\230\021\230!\330\004\013\2101";
static const char __pyx_k_Compiler___setstate_cython[] = "Compiler.__setstate_cython__";
static const char __pyx_k_EncodeMapper_input_symbols[] = "EncodeMapper.input_symbols";
static const char __pyx_k_SymbolTableView_write_text[] = "SymbolTableView.write_text";
static const char __pyx_k_Unknown_replace_label_type[] = "Unknown replace label type: ";
static const char __pyx_k_ArcIterator___reduce_cython[] = "_ArcIterator.__reduce_cython__";
static const char __pyx_k_EncodeMapperSymbolTableView[] = "_EncodeMapperSymbolTableView";
static const char __pyx_k_EncodeMapper_output_symbols[] = "EncodeMapper.output_symbols";
static const char __pyx_k_FarReader___setstate_cython[] = "FarReader.__setstate_cython__";
static const char __pyx_k_FarWriter___setstate_cython[] = "FarWriter.__setstate_cython__";
static const char __pyx_k_MutableArcIterator_position[] = "_MutableArcIterator.position";
static const char __pyx_k_MutableSymbolTable_set_name[] = "_MutableSymbolTable.set_name";
static const char __pyx_k_SymbolTableView_get_nth_key[] = "SymbolTableView.get_nth_key";
static const char __pyx_k_SymbolTableView_num_symbols[] = "SymbolTableView.num_symbols";
static const char __pyx_k_Unknown_compose_filter_type[] = "Unknown compose filter type: ";
static const char __pyx_k_WEIGHT_INVARIANT_PROPERTIES[] = "WEIGHT_INVARIANT_PROPERTIES";
static const char __pyx_k_typing_Literal_input_output[] = "typing.Literal[\"input\", \"output\"]";
static const char __pyx_k_EncodeMapper_write_to_string[] = "EncodeMapper.write_to_string";
static const char __pyx_k_I_LABEL_INVARIANT_PROPERTIES[] = "I_LABEL_INVARIANT_PROPERTIES";
static const char __pyx_k_MutableArcIterator_set_flags[] = "_MutableArcIterator.set_flags";
static const char __pyx_k_MutableArcIterator_set_value[] = "_MutableArcIterator.set_value";
static const char __pyx_k_MutableFst_set_input_symbols[] = "MutableFst.set_input_symbols";
static const char __pyx_k_MutableSymbolTable_add_table[] = "_MutableSymbolTable.add_table";
static const char __pyx_k_O_LABEL_INVARIANT_PROPERTIES[] = "O_LABEL_INVARIANT_PROPERTIES";
static const char __pyx_k_SymbolTable_no_longer_exists[] = "SymbolTable no longer exists";
static const char __pyx_k_Unknown_determinization_type[] = "Unknown determinization type: ";
static const char __pyx_k_read_SymbolTable_from_string[] = "_read_SymbolTable_from_string";
static const char __pyx_k_typing_Literal_ilabel_olabel[] = "typing.Literal[\"ilabel\", \"olabel\"]";
static const char __pyx_k_ArcIterator___setstate_cython[] = "_ArcIterator.__setstate_cython__";
static const char __pyx_k_EncodeMapper_read_from_string[] = "EncodeMapper.read_from_string";
static const char __pyx_k_MutableFst_set_output_symbols[] = "MutableFst.set_output_symbols";
static const char __pyx_k_MutableSymbolTable_add_symbol[] = "_MutableSymbolTable.add_symbol";
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_StateIterator___reduce_cython[] = "_StateIterator.__reduce_cython__";
static const char __pyx_k_SymbolTableView_available_key[] = "SymbolTableView.available_key";
static const char __pyx_k_increment_subsequential_label[] = "increment_subsequential_label";
static const char __pyx_k_read_EncodeMapper_from_string[] = "_read_EncodeMapper_from_string";
static const char __pyx_k_09_AD_vQ_AT_9_l_W_q_E_Qb_vQ_1F[] = "\200\001\330,-\330&'\330/0\3309:\330$%\330@A\360D\001\000\003\010\200v\210Q\320\016$\240A\240T\250\031\260!\340\002!\320!9\270\021\270$\270l\310!\330:;\340\002\005\200W\320\014\037\230q\240\010\250\001\250\033\260E\270\021\330\004\n\210+\220Q\220b\320\030:\270!\340\002\007\200v\210Q\330\006 \240\001\240\021\330!\"\330!\"\330!\"\330!\"\330!\"\330\007\010\330\007\023\2201\220F\230$\230h\240e\2504\250t\2606\270\021\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_4A_a_0_D_T_y_q_8_Q_D_T_y_q_8_Q[] = "\320\0024\260A\330\037>\270a\330\0240\260\001\330\022\023\360.\000\005-\250D\260\005\260T\270\022\270=\310\001\330\004\007\200y\220\007\220q\330\007\023\2208\320\033-\250Q\330\004,\250D\260\005\260T\270\022\270>\310\021\330\004\007\200y\220\007\220q\330\007\023\2208\320\033-\250Q\330\004,\250A\330\004\007\200y\220\007\220q\330\006\022\220(\320\032,\250A\340\004\037\230x\240q\250\001\330\t\n\330\t\017\210q\220\006\220d\230!\330\020\021\330\020\021\330\020\021\330\020\021\330\020\021\330\020\021\330\020\021\330\020\021\330\004\013\2106\220\024\220Q";
static const char __pyx_k_8_4_q_HAQ_axq_q_uD_3a_Jar_IXQa[] = "\200!\330#8\270\001\3604\000\005\033\230-\240q\250\001\330\004\034\230H\240A\240Q\330\004!\240\035\250a\250x\260q\270\001\330\t\n\330\006 \240\007\240q\250\001\330()\330()\330\004\007\200u\210D\220\003\2203\220a\330\006\014\210J\220a\220r\320\031*\250!\330\004\034\230I\240X\250Q\250a\330\004\n\210+\220T\230\021\230!\330\004\013\2101";
static const char __pyx_k_A_a_a_a_a_a_a_a_a_a_vQ_a_uD_3a[] = "\200!\360\036\000\n\013\330\006\021\320\021!\240\021\240&\250\004\250A\330\"#\330\"&\240a\330\"&\240a\330\"&\240a\330\"&\240a\330\"&\240a\330\"&\240a\330\"&\240a\330\"&\240a\330\"&\240a\330\004\010\210\007\210v\220Q\320\026&\240a\330\004\007\200u\210D\220\003\2203\220a\330\006\014\210J\220a\220q\330\004\013\210:\220Q\220e\2308\2401";
static const char __pyx_k_D_q_Qa_D_T_y_q_8_Q_D_T_y_q_8_Q[] = "\200!\340+,\330+,\330+,\330 !\330\030\031\330\037 \330 !\330 !\330 !\330!\"\330!\"\330#$\330$%\330\037 \330'(\330\031\032\360D\001\000\005\033\230-\240q\250\001\340\004\n\210&\220\001\220\034\230Q\230a\330\004,\250D\260\005\260T\270\022\270=\310\001\330\004\007\200y\220\007\220q\330\007\023\2208\320\033-\250Q\330\004,\250D\260\005\260T\270\022\270>\310\021\330\004\007\200y\220\007\220q\330\007\023\2208\320\033-\250Q\330\004,\250A\330\004\007\200y\220\007\220q\330\006\022\220(\320\032,\250A\330\004\031\230\030\240\021\240!\330\004 \240\010\250\001\250\021\330\004\032\230(\240!\2401\330\t\n\330\t\016\210a\210v\220T\230\021\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\025\220Q\330\017\020";
static const char __pyx_k_EncodeMapper_set_input_symbols[] = "EncodeMapper.set_input_symbols";
static const char __pyx_k_GraphViz_server_request_failed[] = "GraphViz server request failed: ";
static const char __pyx_k_Incompatible_or_invalid_weight[] = "Incompatible or invalid weight";
static const char __pyx_k_SymbolTableIterator___setstate[] = "_SymbolTableIterator.__setstate_cython__";
static const char __pyx_k_0101_vQ_AT_9_l_vQ_1_AV4xuD_F_xq[] = "\200\001\330-.\33001\33001\330)*\330*+\330%&\360@\001\000\003\010\200v\210Q\320\016$\240A\240T\250\031\260!\340\002!\320!9\270\021\270$\270l\310!\330:;\340\002\007\200v\210Q\330\006!\240\021\240/\260\021\260(\270!\2701\330\"#\330\"#\330\"#\330\"#\330\"#\330\007\010\330\007\024\220A\220V\2304\230x\240u\250D\260\004\260F\270!\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_01_2_vQ_AT_9_l_56_vQ_AV4xuD_F_x[] = "\200\001\330-.\33001\330:;\330%&\3602\000\003\010\200v\210Q\320\016$\240A\240T\250\031\260!\340\002!\320!9\270\021\270$\270l\310!\33056\340\002\007\200v\210Q\330\006!\240\021\240!\330\"#\330\"#\330\"#\330\007\010\330\007\024\220A\220V\2304\230x\240u\250D\260\004\260F\270!\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_0_0_N_vQ_AT_q_2_81A_AV4xuD_G7_x[] = "\200\001\330%&\330()\330'(\330/0\330/0\330$%\360N\001\000\003\010\200v\210Q\320\016$\240A\240T\250\031\260!\330\002\032\230-\240q\250\001\330&'\330&'\330&'\330\002 \320 2\260!\2608\2701\270A\330\007\010\330\007\014\210A\210V\2204\220x\230u\240D\250\004\250G\2607\270!\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_0_vQ_AU_1_vQ_AQ_0_q_e5_A_e5_A_T[] = "\200\001\340()\330&'\3600\000\003\010\200v\210Q\320\016$\240A\240U\250)\2601\340\002\007\200v\210Q\330\006\034\230A\230Q\330\0350\260\001\260\030\270\021\270!\330\007\010\330\007\017\210q\220\006\220e\2305\240\004\240A\330\020\026\220e\2305\240\004\240A\330\020\025\220T\230\021\330\020\026\220e\2304\230q\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_12_P_xz_Jd_AXU_t1_vQ_AV1BgXQ_aq[] = "\200\001\330+,\330-.\33012\330./\360P\001\000\003\010\200x\210z\230\021\330\006\014\210J\220d\320\032,\250A\250X\260U\270%\270t\3001\340\002\007\200v\210Q\320\016$\240A\240V\2501\250B\250g\260X\270Q\330\002#\320#:\270!\330\006\016\210a\210q\330\006\007\330\002#\320#:\270!\330\006\016\210a\210q\330\006\007\340\002\007\200v\210Q\320\016$\240A\240V\2501\250B\250h\260f\270F\300!\330\007\010\330\007\017\210q\220\010\230\005\230T\240\024\240V\2501\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_2_vQ_AU_1_vQ_AQ_q_6_e4q_e4q_A_d[] = "\200\001\340+,\330)*\3602\000\003\010\200v\210Q\320\016$\240A\240U\250)\2601\340\002\007\200v\210Q\330\006\034\230A\230Q\330\034/\250q\260\010\270\001\270\021\330\007\010\330\007\022\220!\2206\230\025\230e\2404\240q\330\023\031\230\025\230e\2404\240q\330\023\030\230\004\230A\330\023\031\230\025\230d\240!\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_CGq_23_Qhaq_vQ_2_134343434_vQ_A[] = "\200\001\330'(\330 !\330CG\300q\330'(\33023\330*+\360<\000\003'\320&=\270Q\270h\300a\300q\340\002\007\200v\210Q\330\0062\260!\2601\33034\33034\33034\33034\340\002\007\200v\210Q\320\016$\240A\240T\250\031\260!\330\002\033\2308\2401\240A\330\007\010\330\007\017\210q\220\006\220d\230(\240%\240t\2504\250v\260X\270Q\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_Can_t_set_value_on_an_exhausted[] = "Can't set value on an exhausted iterator";
static const char __pyx_k_DH_6_Qhaq_vQ_31A45454545_81A_oQ[] = "\320\000\031\230\021\340()\330)*\330!\"\330DH\310\001\330+,\3606\000\003'\320&=\270Q\270h\300a\300q\360\006\000\003\010\200v\210Q\330\0073\2601\260A\33045\33045\33045\33045\330\002\033\2308\2401\240A\330\007\010\330\004\016\210o\230Q\230f\240E\250\021\330\036$\240E\250\021\330\036\037\330\036$\240A\330\036\037\330\036\037";
static const char __pyx_k_EncodeMapper_set_output_symbols[] = "EncodeMapper.set_output_symbols";
static const char __pyx_k_MutableArcIterator___reduce_cyt[] = "_MutableArcIterator.__reduce_cython__";
static const char __pyx_k_MutableArcIterator___setstate_c[] = "_MutableArcIterator.__setstate_cython__";
static const char __pyx_k_StateIterator___setstate_cython[] = "_StateIterator.__setstate_cython__";
static const char __pyx_k_SymbolTableIterator___reduce_cy[] = "_SymbolTableIterator.__reduce_cython__";
static const char __pyx_k_SymbolTableView_write_to_string[] = "SymbolTableView.write_to_string";
static const char __pyx_k_const_EncodeMapper_SymbolTableV[] = "<const EncodeMapper SymbolTableView ";
static const char __pyx_k_e4r_D_F_avT_5_Bm1_5_BnA_1F_a_m1[] = "\200!\360\020\000\005\033\230$\230e\2404\240r\250\033\260D\270\014\300F\310!\330\035\036\330\t\n\330\t\016\210a\210v\220T\230\021\330\017\023\2205\230\004\230B\230m\2501\330\017\023\2205\230\004\230B\230n\250A\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\330\017\020\340\004\005\330\006\020\320\020#\2401\240F\250$\250a\330\004\013\210=\230\001\330\006\016\210m\2301\320\034?\270r\300\023\300A\300Q\330\006\r\210V\2201\320\024<\270A\340\004\005\330\006\020\320\020\"\240!\2406\250\024\250Q\330\004\013\210=\230\001\330\006\r\210V\2201\320\0240\260\001";
static const char __pyx_k_self__it_cannot_be_converted_to[] = "self._it cannot be converted to a Python object for pickling";
static const char __pyx_k_typing_Literal_uniform_log_prob[] = "typing.Literal[\"uniform\", \"log_prob\", \"fast_log_prob\"]";
static const char __pyx_k_vQ_AU_1_vQ_AQ_q_U_a_U_a_t1_T_xq[] = "\200\001\340*+\330()\360.\000\003\010\200v\210Q\320\016$\240A\240U\250)\2601\340\002\007\200v\210Q\330\006\034\230A\230Q\330\034/\250q\260\010\270\001\270\021\330\007\010\330\007\021\220\021\220&\230\005\230U\240$\240a\330\022\030\230\005\230U\240$\240a\330\022\027\220t\2301\330\022\030\230\005\230T\240\021\330\002\t\320\t\031\230\021\230%\230x\240q";
static const char __pyx_k_Argument_FST_did_not_satisfy_pre[] = "Argument FST did not satisfy preconditions";
static const char __pyx_k_Can_t_get_value_from_an_exhauste[] = "Can't get value from an exhausted iterator";
static const char __pyx_k_Graphviz_server_requested_failed[] = "Graphviz server requested failed: %s";
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_MutableFst_mutable_input_symbols[] = "MutableFst.mutable_input_symbols";
static const char __pyx_k_MutableFst_mutable_output_symbol[] = "MutableFst.mutable_output_symbols";
static const char __pyx_k_Note_that_Cython_is_deliberately[] = "Note that Cython is deliberately stricter than PEP-484 and rejects subclasses of builtin types. If you need to pass subclasses then set the 'annotation_typing' directive to False.";
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_SymbolTableView_labeled_checksum[] = "SymbolTableView.labeled_checksum";
static const char __pyx_k_Unknown_epsilon_normalization_ty[] = "Unknown epsilon normalization type: ";
static const char __pyx_k_Unknown_random_arc_selection_typ[] = "Unknown random arc selection type: ";
static const char __pyx_k_google3_visualization_graphviz_s[] = "google3.visualization.graphviz_server.proto";
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__arc_cannot_be_converted_to[] = "self._arc cannot be converted to a Python object for pickling";
static const char __pyx_k_self__fst_self__it_cannot_be_con[] = "self._fst,self._it cannot be converted to a Python object for pickling";
static const char __pyx_k_self__fst_self__it_self__mfst_se[] = "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling";
static const char __pyx_k_self__reader_cannot_be_converted[] = "self._reader cannot be converted to a Python object for pickling";
static const char __pyx_k_self__weight_cannot_be_converted[] = "self._weight cannot be converted to a Python object for pickling";
static const char __pyx_k_self__writer_cannot_be_converted[] = "self._writer cannot be converted to a Python object for pickling";
static const char __pyx_k_typing_Literal_alt_sequence_auto[] = "typing.Literal[\"alt_sequence\", \"auto\", \"match\", \"no_match\",\n                           \"null\", \"sequence\", \"trivial\"]";
static const char __pyx_k_typing_Literal_arc_sum_arc_uniqu[] = "typing.Literal[\"arc_sum\", \"arc_unique\", \"identity\"]";
static const char __pyx_k_typing_Literal_auto_fifo_lifo_sh[] = "typing.Literal[\"auto\", \"fifo\", \"lifo\", \"shortest\", \"state\",\n                              \"top\"]";
static const char __pyx_k_typing_Literal_fst_stlist_sttabl[] = "typing.Literal[\n  \"fst\",\n  \"stlist\",\n  \"sttable\",\n  # copybara:strip_begin\n  \"sstable\",\n  # copybara:strip_end\n  \"default\"\n]";
static const char __pyx_k_typing_Literal_functional_nonfun[] = "typing.Literal[\"functional\", \"nonfunctional\",\n                                    \"disambiguate\"]";
static const char __pyx_k_typing_Literal_identity_input_ep[] = "typing.Literal[\"identity\", \"input_epsilon\", \"invert\",\n                               \"output_epsilon\", \"plus\", \"power\", \"quantize\",\n                               \"rmweight\", \"superfinal\", \"times\", \"to_log\",\n                               # NOTE: Both spellings of \"to_std\"\n                               \"to_log64\", \"to_std\", \"to_standard\"]";
static const char __pyx_k_typing_Literal_neither_input_out[] = "typing.Literal[\"neither\", \"input\", \"output\", \"both\"]";
static const char __pyx_k_typing_Literal_to_initial_to_fin[] = "typing.Literal[\"to_initial\", \"to_final\"]";
static const char __pyx_k_typing_Union_Weight_typing_Union[] = "typing.Union[Weight, typing.Union[str, int, float]]";
/* #### Code section: decls ### */
static int __pyx_pf_9pywrapfst_6Weight___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_2copy(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_4type(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_6to_string(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_8__repr__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_10__str__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_12__float__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_14member(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_16properties(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_18__eq__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_20__ne__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w1, struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w2); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_22zero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_24one(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_26no_weight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_6Weight_30__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_15SymbolTableView___init__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_2__iter__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_4__reduce__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_6available_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_8checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_10copy(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_12find(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_14get_nth_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_16labeled_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_18member(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_20name(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_22num_symbols(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_24write(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_26write_text(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_sep); /* proto */
static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_28write_to_string(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_28_EncodeMapperSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_FstSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableSymbolTable_add_symbol(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, PyObject *__pyx_v_symbol, int64_t __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_SymbolTableView *__pyx_v_symbols); /* 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_26_MutableFstSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self); /* 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_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_6read_text(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, PyObject *__pyx_v_sep); /* proto */
static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_8read_fst(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_input_table); /* proto */
static PyObject *__pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator___repr__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_4__iter__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_6__next__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_10__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_4__call__(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_6__reduce__(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_8arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_10weight_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_12flags(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_16read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_18read_from_string(PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_20write(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_22write_to_string(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_24input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_26output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst__repr_svg_(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_3Fst_2__init__(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_4__reduce__(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_6__repr__(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_8__str__(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_10arc_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_12arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_14copy(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_16draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, PyObject *__pyx_v_title, double __pyx_v_width, double __pyx_v_height, bool __pyx_v_portrait, bool __pyx_v_vertical, double __pyx_v_ranksep, double __pyx_v_nodesep, int32_t __pyx_v_fontsize, int32_t __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one, PyObject *__pyx_v_format); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_18final(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_20fst_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_22input_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_24num_states_if_known(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_26num_arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_28num_input_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_30num_output_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_32output_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_34print(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_36properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_mask, bool __pyx_v_test); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_38read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_40read_from_string(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_42start(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_44states(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_46verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_48weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_50write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_3Fst_52write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_add_arc(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_2add_state(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_4add_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_6arcsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_8closure(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_closure_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_10concat(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst2); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_12connect(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_14decode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_16delete_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_18delete_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_states); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_20encode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_22invert(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_24minimize(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_allow_nondet); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_26mutable_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_28mutable_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_30mutable_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_32num_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_34project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_36prune(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, int64_t __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_38push(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, PyObject *__pyx_v_reweight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_40relabel_pairs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_ipairs, PyObject *__pyx_v_opairs); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_42relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_44reserve_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, size_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_46reserve_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_n); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_48reweight(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, PyObject *__pyx_v_reweight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_50rmepsilon(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, int64_t __pyx_v_nstate, float __pyx_v_delta); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_52set_final(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_54set_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_56set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_props, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_60set_start(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_62topsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_10MutableFst_64union(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_fsts2); /* proto */
static int __pyx_pf_9pywrapfst_9VectorFst___init__(struct __pyx_obj_9pywrapfst_VectorFst *__pyx_v_self, PyObject *__pyx_v_arc_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_16_read_Fst(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_9pywrapfst_18_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __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, int64_t __pyx_v_ilabel, int64_t __pyx_v_olabel, PyObject *__pyx_v_weight, int64_t __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, int64_t __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, int64_t __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, int64_t __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_12_ArcIterator___repr__(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_12_ArcIterator_2__init__(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_4__iter__(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_6__next__(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_8done(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_10flags(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_12next(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_14position(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_16reset(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_18seek(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, size_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_20set_flags(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_22value(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_24__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_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_19_MutableArcIterator___repr__(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_19_MutableArcIterator_2__init__(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_ifst, int64_t __pyx_v_state); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_4__iter__(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_6__next__(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_8done(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_10flags(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_12next(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_14position(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_16reset(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_18seek(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, size_t __pyx_v_a); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_20set_flags(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_mask); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_22set_value(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_24value(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_26__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_28__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_14_StateIterator___repr__(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static int __pyx_pf_9pywrapfst_14_StateIterator_2__init__(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_4__iter__(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_6__next__(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_8done(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_10next(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_12reset(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_14value(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_16__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_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_20arcmap(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_22compose(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_24convert(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_fst_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_26determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_det_type, int64_t __pyx_v_nstate, int64_t __pyx_v_subsequential_label, PyObject *__pyx_v_weight, bool __pyx_v_increment_subsequential_label); /* proto */
static PyObject *__pyx_pf_9pywrapfst_28difference(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_30disambiguate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64_t __pyx_v_nstate, int64_t __pyx_v_subsequential_label, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_32epsnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_eps_norm_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_34equal(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_36equivalent(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_38intersect(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_40isomorphic(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_42prune(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64_t __pyx_v_nstate, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_44push(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, PyObject *__pyx_v_reweight_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_46randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, int32_t __pyx_v_npath, float __pyx_v_delta, PyObject *__pyx_v_select, int32_t __pyx_v_max_length, uint64_t __pyx_v_seed); /* proto */
static PyObject *__pyx_pf_9pywrapfst_48randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, int32_t __pyx_v_npath, PyObject *__pyx_v_select, int32_t __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight, uint64_t __pyx_v_seed); /* proto */
static PyObject *__pyx_pf_9pywrapfst_50replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pairs, PyObject *__pyx_v_call_arc_labeling, PyObject *__pyx_v_return_arc_labeling, bool __pyx_v_epsilon_on_replace, int64_t __pyx_v_return_label); /* proto */
static PyObject *__pyx_pf_9pywrapfst_52reverse(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, bool __pyx_v_require_superinitial); /* proto */
static PyObject *__pyx_pf_9pywrapfst_62__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_54shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64_t __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse); /* proto */
static PyObject *__pyx_pf_9pywrapfst_56shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int32_t __pyx_v_nshortest, int64_t __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_unique, PyObject *__pyx_v_weight); /* proto */
static PyObject *__pyx_pf_9pywrapfst_58statemap(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_map_type); /* proto */
static PyObject *__pyx_pf_9pywrapfst_60synchronize(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, PyObject *__pyx_v_fst_type, PyObject *__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); /* 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_sources); /* 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__next__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_28__iter__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9pywrapfst_9FarReader_32__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_source, 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_tp_new_9pywrapfst_Weight(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst_SymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9pywrapfst__FstSymbolTableView(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__MutableFstSymbolTableView(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_VectorFst(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_tp_new_9pywrapfst___pyx_defaults(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
/* SmallCodeConfig */
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  #ifdef __Pyx_Generator_USED
  PyTypeObject *__pyx_GeneratorType;
  #endif
  #ifdef __Pyx_IterableCoroutine_USED
  PyTypeObject *__pyx_IterableCoroutineType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineAwaitType;
  #endif
  #ifdef __Pyx_Coroutine_USED
  PyTypeObject *__pyx_CoroutineType;
  #endif
  PyObject *__pyx_type_9pywrapfst_Weight;
  PyObject *__pyx_type_9pywrapfst_SymbolTableView;
  PyObject *__pyx_type_9pywrapfst__EncodeMapperSymbolTableView;
  PyObject *__pyx_type_9pywrapfst__FstSymbolTableView;
  PyObject *__pyx_type_9pywrapfst__MutableSymbolTable;
  PyObject *__pyx_type_9pywrapfst__MutableFstSymbolTableView;
  PyObject *__pyx_type_9pywrapfst_SymbolTable;
  PyObject *__pyx_type_9pywrapfst__SymbolTableIterator;
  PyObject *__pyx_type_9pywrapfst_EncodeMapper;
  PyObject *__pyx_type_9pywrapfst_Fst;
  PyObject *__pyx_type_9pywrapfst_MutableFst;
  PyObject *__pyx_type_9pywrapfst_VectorFst;
  PyObject *__pyx_type_9pywrapfst_Arc;
  PyObject *__pyx_type_9pywrapfst__ArcIterator;
  PyObject *__pyx_type_9pywrapfst__MutableArcIterator;
  PyObject *__pyx_type_9pywrapfst__StateIterator;
  PyObject *__pyx_type_9pywrapfst_Compiler;
  PyObject *__pyx_type_9pywrapfst_FarReader;
  PyObject *__pyx_type_9pywrapfst_FarWriter;
  PyObject *__pyx_type_9pywrapfst___pyx_defaults;
  PyTypeObject *__pyx_ptype_9pywrapfst_Weight;
  PyTypeObject *__pyx_ptype_9pywrapfst_SymbolTableView;
  PyTypeObject *__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView;
  PyTypeObject *__pyx_ptype_9pywrapfst__FstSymbolTableView;
  PyTypeObject *__pyx_ptype_9pywrapfst__MutableSymbolTable;
  PyTypeObject *__pyx_ptype_9pywrapfst__MutableFstSymbolTableView;
  PyTypeObject *__pyx_ptype_9pywrapfst_SymbolTable;
  PyTypeObject *__pyx_ptype_9pywrapfst__SymbolTableIterator;
  PyTypeObject *__pyx_ptype_9pywrapfst_EncodeMapper;
  PyTypeObject *__pyx_ptype_9pywrapfst_Fst;
  PyTypeObject *__pyx_ptype_9pywrapfst_MutableFst;
  PyTypeObject *__pyx_ptype_9pywrapfst_VectorFst;
  PyTypeObject *__pyx_ptype_9pywrapfst_Arc;
  PyTypeObject *__pyx_ptype_9pywrapfst__ArcIterator;
  PyTypeObject *__pyx_ptype_9pywrapfst__MutableArcIterator;
  PyTypeObject *__pyx_ptype_9pywrapfst__StateIterator;
  PyTypeObject *__pyx_ptype_9pywrapfst_Compiler;
  PyTypeObject *__pyx_ptype_9pywrapfst_FarReader;
  PyTypeObject *__pyx_ptype_9pywrapfst_FarWriter;
  PyTypeObject *__pyx_ptype_9pywrapfst___pyx_defaults;
  __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  int64_t __pyx_k__5;
  float __pyx_k__7;
  float __pyx_k__8;
  float __pyx_k__9;
  int64_t __pyx_k__10;
  float __pyx_k__11;
  int64_t __pyx_k__12;
  float __pyx_k__13;
  float __pyx_k__14;
  int64_t __pyx_k__15;
  float __pyx_k__16;
  int64_t __pyx_k__17;
  float __pyx_k__18;
  float __pyx_k__19;
  float __pyx_k__20;
  float __pyx_k__21;
  int64_t __pyx_k__22;
  float __pyx_k__23;
  int64_t __pyx_k__24;
  float __pyx_k__25;
  float __pyx_k__26;
  float __pyx_k__27;
  float __pyx_k__28;
  int64_t __pyx_k__29;
  float __pyx_k__30;
  float __pyx_k__31;
  int32_t __pyx_k__32;
  uint64_t __pyx_k__33;
  int32_t __pyx_k__34;
  uint64_t __pyx_k__35;
  float __pyx_k__36;
  int64_t __pyx_k__37;
  float __pyx_k__38;
  int64_t __pyx_k__39;
  PyObject *__pyx_tuple[17];
  PyObject *__pyx_codeobj_tab[185];
  PyObject *__pyx_string_tab[696];
  PyObject *__pyx_float_1_;
  PyObject *__pyx_float_0_4;
  PyObject *__pyx_float_8_5;
  PyObject *__pyx_float_0_25;
  PyObject *__pyx_float_11_0;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_5;
  PyObject *__pyx_int_14;
/* #### Code section: module_state_contents ### */
/* CachedMethodType.module_state_decls */
#if CYTHON_COMPILING_IN_LIMITED_API
PyObject *__Pyx_CachedMethodType;
#endif

/* CodeObjectCache.module_state_decls */
struct __Pyx_CodeObjectCache __pyx_code_cache;

/* #### Code section: module_state_end ### */
} __pyx_mstatetype;

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

#define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))

#define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
#else
static __pyx_mstatetype __pyx_mstate_global_static =
#ifdef __cplusplus
    {};
#else
    {0};
#endif
static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
#endif
/* #### Code section: constant_name_defines ### */
#define __pyx_kp_u_ __pyx_string_tab[0]
#define __pyx_n_u_ACCEPTOR __pyx_string_tab[1]
#define __pyx_n_u_ACCESSIBLE __pyx_string_tab[2]
#define __pyx_n_u_ACYCLIC __pyx_string_tab[3]
#define __pyx_n_u_ADD_ARC_PROPERTIES __pyx_string_tab[4]
#define __pyx_n_u_ADD_STATE_PROPERTIES __pyx_string_tab[5]
#define __pyx_n_u_ADD_SUPERFINAL_PROPERTIES __pyx_string_tab[6]
#define __pyx_n_u_ARC_FLAGS __pyx_string_tab[7]
#define __pyx_n_u_ARC_I_LABEL_VALUE __pyx_string_tab[8]
#define __pyx_n_u_ARC_NEXT_STATE_VALUE __pyx_string_tab[9]
#define __pyx_n_u_ARC_NO_CACHE __pyx_string_tab[10]
#define __pyx_n_u_ARC_O_LABEL_VALUE __pyx_string_tab[11]
#define __pyx_n_u_ARC_SORT_PROPERTIES __pyx_string_tab[12]
#define __pyx_n_u_ARC_VALUE_FLAGS __pyx_string_tab[13]
#define __pyx_n_u_ARC_WEIGHT_VALUE __pyx_string_tab[14]
#define __pyx_n_u_Arc __pyx_string_tab[15]
#define __pyx_n_u_ArcIterator __pyx_string_tab[16]
#define __pyx_n_u_ArcIteratorFlags __pyx_string_tab[17]
#define __pyx_n_u_ArcIterator___reduce_cython __pyx_string_tab[18]
#define __pyx_n_u_ArcIterator___setstate_cython __pyx_string_tab[19]
#define __pyx_kp_u_ArcIterator_at_0x __pyx_string_tab[20]
#define __pyx_n_u_ArcIterator_done __pyx_string_tab[21]
#define __pyx_n_u_ArcIterator_flags __pyx_string_tab[22]
#define __pyx_n_u_ArcIterator_next __pyx_string_tab[23]
#define __pyx_n_u_ArcIterator_position __pyx_string_tab[24]
#define __pyx_n_u_ArcIterator_reset __pyx_string_tab[25]
#define __pyx_n_u_ArcIterator_seek __pyx_string_tab[26]
#define __pyx_n_u_ArcIterator_set_flags __pyx_string_tab[27]
#define __pyx_n_u_ArcIterator_value __pyx_string_tab[28]
#define __pyx_n_u_ArcMapType __pyx_string_tab[29]
#define __pyx_n_u_Arc___reduce_cython __pyx_string_tab[30]
#define __pyx_n_u_Arc___setstate_cython __pyx_string_tab[31]
#define __pyx_kp_u_Arc_at_0x __pyx_string_tab[32]
#define __pyx_n_u_Arc_copy __pyx_string_tab[33]
#define __pyx_kp_u_Argument_FST_did_not_satisfy_pre __pyx_string_tab[34]
#define __pyx_n_u_BINARY_PROPERTIES __pyx_string_tab[35]
#define __pyx_n_u_COACCESSIBLE __pyx_string_tab[36]
#define __pyx_n_u_COMMUTATIVE __pyx_string_tab[37]
#define __pyx_n_u_COPY_PROPERTIES __pyx_string_tab[38]
#define __pyx_n_u_CYCLIC __pyx_string_tab[39]
#define __pyx_n_u_Call __pyx_string_tab[40]
#define __pyx_kp_u_Can_t_get_value_from_an_exhauste __pyx_string_tab[41]
#define __pyx_kp_u_Can_t_set_value_on_an_exhausted __pyx_string_tab[42]
#define __pyx_kp_u_Cannot_construct __pyx_string_tab[43]
#define __pyx_kp_u_Cannot_topsort_cyclic_FST __pyx_string_tab[44]
#define __pyx_n_u_ClosureType __pyx_string_tab[45]
#define __pyx_kp_u_Compilation_failed __pyx_string_tab[46]
#define __pyx_n_u_Compiler __pyx_string_tab[47]
#define __pyx_n_u_Compiler___reduce_cython __pyx_string_tab[48]
#define __pyx_n_u_Compiler___setstate_cython __pyx_string_tab[49]
#define __pyx_n_u_Compiler_compile __pyx_string_tab[50]
#define __pyx_n_u_Compiler_write __pyx_string_tab[51]
#define __pyx_n_u_ComposeFilter __pyx_string_tab[52]
#define __pyx_kp_u_Conversion_to __pyx_string_tab[53]
#define __pyx_n_u_DELETE_ARC_PROPERTIES __pyx_string_tab[54]
#define __pyx_n_u_DELETE_STATE_PROPERTIES __pyx_string_tab[55]
#define __pyx_n_u_DeterminizeType __pyx_string_tab[56]
#define __pyx_n_u_DisplayToast __pyx_string_tab[57]
#define __pyx_kp_u_Dot_rendering_failed_s __pyx_string_tab[58]
#define __pyx_n_u_DrawFloatFormat __pyx_string_tab[59]
#define __pyx_n_u_ENCODE_FLAGS __pyx_string_tab[60]
#define __pyx_n_u_ENCODE_LABELS __pyx_string_tab[61]
#define __pyx_n_u_ENCODE_WEIGHTS __pyx_string_tab[62]
#define __pyx_n_u_EPSILONS __pyx_string_tab[63]
#define __pyx_n_u_ERROR __pyx_string_tab[64]
#define __pyx_n_u_EXPANDED __pyx_string_tab[65]
#define __pyx_n_u_EXTRINSIC_PROPERTIES __pyx_string_tab[66]
#define __pyx_n_u_EncodeMapper __pyx_string_tab[67]
#define __pyx_n_u_EncodeMapperFlags __pyx_string_tab[68]
#define __pyx_n_u_EncodeMapperSymbolTableView __pyx_string_tab[69]
#define __pyx_n_u_EncodeMapper___reduce __pyx_string_tab[70]
#define __pyx_n_u_EncodeMapper_arc_type __pyx_string_tab[71]
#define __pyx_kp_u_EncodeMapper_at_0x __pyx_string_tab[72]
#define __pyx_n_u_EncodeMapper_flags __pyx_string_tab[73]
#define __pyx_n_u_EncodeMapper_input_symbols __pyx_string_tab[74]
#define __pyx_n_u_EncodeMapper_output_symbols __pyx_string_tab[75]
#define __pyx_n_u_EncodeMapper_properties __pyx_string_tab[76]
#define __pyx_n_u_EncodeMapper_read __pyx_string_tab[77]
#define __pyx_n_u_EncodeMapper_read_from_string __pyx_string_tab[78]
#define __pyx_n_u_EncodeMapper_set_input_symbols __pyx_string_tab[79]
#define __pyx_n_u_EncodeMapper_set_output_symbols __pyx_string_tab[80]
#define __pyx_n_u_EncodeMapper_weight_type __pyx_string_tab[81]
#define __pyx_n_u_EncodeMapper_write __pyx_string_tab[82]
#define __pyx_n_u_EncodeMapper_write_to_string __pyx_string_tab[83]
#define __pyx_n_u_EpsNormalizeType __pyx_string_tab[84]
#define __pyx_kp_u_Expected __pyx_string_tab[85]
#define __pyx_n_u_FST_PROPERTIES __pyx_string_tab[86]
#define __pyx_n_u_FarReader __pyx_string_tab[87]
#define __pyx_n_u_FarReader___reduce_cython __pyx_string_tab[88]
#define __pyx_n_u_FarReader___setstate_cython __pyx_string_tab[89]
#define __pyx_n_u_FarReader_arc_type __pyx_string_tab[90]
#define __pyx_kp_u_FarReader_at_0x __pyx_string_tab[91]
#define __pyx_n_u_FarReader_done __pyx_string_tab[92]
#define __pyx_n_u_FarReader_error __pyx_string_tab[93]
#define __pyx_n_u_FarReader_far_type __pyx_string_tab[94]
#define __pyx_n_u_FarReader_find __pyx_string_tab[95]
#define __pyx_n_u_FarReader_get_fst __pyx_string_tab[96]
#define __pyx_n_u_FarReader_get_key __pyx_string_tab[97]
#define __pyx_n_u_FarReader_next __pyx_string_tab[98]
#define __pyx_n_u_FarReader_open __pyx_string_tab[99]
#define __pyx_n_u_FarReader_reset __pyx_string_tab[100]
#define __pyx_n_u_FarType __pyx_string_tab[101]
#define __pyx_n_u_FarWriter __pyx_string_tab[102]
#define __pyx_n_u_FarWriter___reduce_cython __pyx_string_tab[103]
#define __pyx_n_u_FarWriter___setstate_cython __pyx_string_tab[104]
#define __pyx_n_u_FarWriter_add __pyx_string_tab[105]
#define __pyx_n_u_FarWriter_arc_type __pyx_string_tab[106]
#define __pyx_kp_u_FarWriter_at_0x __pyx_string_tab[107]
#define __pyx_n_u_FarWriter_create __pyx_string_tab[108]
#define __pyx_n_u_FarWriter_error __pyx_string_tab[109]
#define __pyx_n_u_FarWriter_far_type __pyx_string_tab[110]
#define __pyx_n_u_Flag __pyx_string_tab[111]
#define __pyx_n_u_Fst __pyx_string_tab[112]
#define __pyx_n_u_FstArgError __pyx_string_tab[113]
#define __pyx_n_u_FstBadWeightError __pyx_string_tab[114]
#define __pyx_n_u_FstError __pyx_string_tab[115]
#define __pyx_n_u_FstIOError __pyx_string_tab[116]
#define __pyx_n_u_FstIndexError __pyx_string_tab[117]
#define __pyx_n_u_FstOpError __pyx_string_tab[118]
#define __pyx_n_u_FstProperties __pyx_string_tab[119]
#define __pyx_n_u_FstSymbolTableView __pyx_string_tab[120]
#define __pyx_kp_u_Fst_SymbolTableView __pyx_string_tab[121]
#define __pyx_n_u_Fst___reduce __pyx_string_tab[122]
#define __pyx_n_u_Fst__repr_svg __pyx_string_tab[123]
#define __pyx_n_u_Fst_arc_type __pyx_string_tab[124]
#define __pyx_n_u_Fst_arcs __pyx_string_tab[125]
#define __pyx_kp_u_Fst_at_0x __pyx_string_tab[126]
#define __pyx_n_u_Fst_copy __pyx_string_tab[127]
#define __pyx_n_u_Fst_draw __pyx_string_tab[128]
#define __pyx_n_u_Fst_final __pyx_string_tab[129]
#define __pyx_n_u_Fst_fst_type __pyx_string_tab[130]
#define __pyx_n_u_Fst_input_symbols __pyx_string_tab[131]
#define __pyx_n_u_Fst_num_arcs __pyx_string_tab[132]
#define __pyx_n_u_Fst_num_input_epsilons __pyx_string_tab[133]
#define __pyx_n_u_Fst_num_output_epsilons __pyx_string_tab[134]
#define __pyx_n_u_Fst_num_states_if_known __pyx_string_tab[135]
#define __pyx_n_u_Fst_output_symbols __pyx_string_tab[136]
#define __pyx_n_u_Fst_print __pyx_string_tab[137]
#define __pyx_n_u_Fst_properties __pyx_string_tab[138]
#define __pyx_n_u_Fst_read __pyx_string_tab[139]
#define __pyx_n_u_Fst_read_from_string __pyx_string_tab[140]
#define __pyx_n_u_Fst_start __pyx_string_tab[141]
#define __pyx_n_u_Fst_states __pyx_string_tab[142]
#define __pyx_n_u_Fst_verify __pyx_string_tab[143]
#define __pyx_n_u_Fst_weight_type __pyx_string_tab[144]
#define __pyx_n_u_Fst_write __pyx_string_tab[145]
#define __pyx_n_u_Fst_write_to_string __pyx_string_tab[146]
#define __pyx_kp_u_GraphViz_server_request_failed __pyx_string_tab[147]
#define __pyx_kp_u_Graphviz_server_requested_failed __pyx_string_tab[148]
#define __pyx_n_u_IDEMPOTENT __pyx_string_tab[149]
#define __pyx_n_u_INITIAL_ACYCLIC __pyx_string_tab[150]
#define __pyx_n_u_INITIAL_CYCLIC __pyx_string_tab[151]
#define __pyx_n_u_INTRINSIC_PROPERTIES __pyx_string_tab[152]
#define __pyx_n_u_IOError __pyx_string_tab[153]
#define __pyx_n_u_I_DETERMINISTIC __pyx_string_tab[154]
#define __pyx_n_u_I_EPSILONS __pyx_string_tab[155]
#define __pyx_n_u_I_LABEL_INVARIANT_PROPERTIES __pyx_string_tab[156]
#define __pyx_n_u_I_LABEL_SORTED __pyx_string_tab[157]
#define __pyx_n_u_ImportError __pyx_string_tab[158]
#define __pyx_kp_u_Incompatible_or_invalid_arc_type __pyx_string_tab[159]
#define __pyx_kp_u_Incompatible_or_invalid_weight __pyx_string_tab[160]
#define __pyx_kp_u_Incompatible_or_invalid_weight_t __pyx_string_tab[161]
#define __pyx_n_u_IndexError __pyx_string_tab[162]
#define __pyx_kp_u_Invalid_weight __pyx_string_tab[163]
#define __pyx_n_u_KeyError __pyx_string_tab[164]
#define __pyx_n_u_LEFT_SEMIRING __pyx_string_tab[165]
#define __pyx_kp_u_Literal_star_plus __pyx_string_tab[166]
#define __pyx_n_u_MUTABLE __pyx_string_tab[167]
#define __pyx_n_u_MutableArcIterator __pyx_string_tab[168]
#define __pyx_n_u_MutableArcIterator___reduce_cyt __pyx_string_tab[169]
#define __pyx_n_u_MutableArcIterator___setstate_c __pyx_string_tab[170]
#define __pyx_kp_u_MutableArcIterator_at_0x __pyx_string_tab[171]
#define __pyx_n_u_MutableArcIterator_done __pyx_string_tab[172]
#define __pyx_n_u_MutableArcIterator_flags __pyx_string_tab[173]
#define __pyx_n_u_MutableArcIterator_next __pyx_string_tab[174]
#define __pyx_n_u_MutableArcIterator_position __pyx_string_tab[175]
#define __pyx_n_u_MutableArcIterator_reset __pyx_string_tab[176]
#define __pyx_n_u_MutableArcIterator_seek __pyx_string_tab[177]
#define __pyx_n_u_MutableArcIterator_set_flags __pyx_string_tab[178]
#define __pyx_n_u_MutableArcIterator_set_value __pyx_string_tab[179]
#define __pyx_n_u_MutableArcIterator_value __pyx_string_tab[180]
#define __pyx_n_u_MutableFst __pyx_string_tab[181]
#define __pyx_n_u_MutableFstSymbolTableView __pyx_string_tab[182]
#define __pyx_n_u_MutableFst_add_arc __pyx_string_tab[183]
#define __pyx_n_u_MutableFst_add_state __pyx_string_tab[184]
#define __pyx_n_u_MutableFst_add_states __pyx_string_tab[185]
#define __pyx_n_u_MutableFst_arcsort __pyx_string_tab[186]
#define __pyx_n_u_MutableFst_closure __pyx_string_tab[187]
#define __pyx_n_u_MutableFst_concat __pyx_string_tab[188]
#define __pyx_n_u_MutableFst_connect __pyx_string_tab[189]
#define __pyx_n_u_MutableFst_decode __pyx_string_tab[190]
#define __pyx_n_u_MutableFst_delete_arcs __pyx_string_tab[191]
#define __pyx_n_u_MutableFst_delete_states __pyx_string_tab[192]
#define __pyx_n_u_MutableFst_encode __pyx_string_tab[193]
#define __pyx_n_u_MutableFst_invert __pyx_string_tab[194]
#define __pyx_n_u_MutableFst_minimize __pyx_string_tab[195]
#define __pyx_n_u_MutableFst_mutable_arcs __pyx_string_tab[196]
#define __pyx_n_u_MutableFst_mutable_input_symbols __pyx_string_tab[197]
#define __pyx_n_u_MutableFst_mutable_output_symbol __pyx_string_tab[198]
#define __pyx_n_u_MutableFst_num_states __pyx_string_tab[199]
#define __pyx_n_u_MutableFst_project __pyx_string_tab[200]
#define __pyx_n_u_MutableFst_prune __pyx_string_tab[201]
#define __pyx_n_u_MutableFst_push __pyx_string_tab[202]
#define __pyx_n_u_MutableFst_relabel_pairs __pyx_string_tab[203]
#define __pyx_n_u_MutableFst_relabel_tables __pyx_string_tab[204]
#define __pyx_n_u_MutableFst_reserve_arcs __pyx_string_tab[205]
#define __pyx_n_u_MutableFst_reserve_states __pyx_string_tab[206]
#define __pyx_n_u_MutableFst_reweight __pyx_string_tab[207]
#define __pyx_n_u_MutableFst_rmepsilon __pyx_string_tab[208]
#define __pyx_n_u_MutableFst_set_final __pyx_string_tab[209]
#define __pyx_n_u_MutableFst_set_input_symbols __pyx_string_tab[210]
#define __pyx_n_u_MutableFst_set_output_symbols __pyx_string_tab[211]
#define __pyx_n_u_MutableFst_set_properties __pyx_string_tab[212]
#define __pyx_n_u_MutableFst_set_start __pyx_string_tab[213]
#define __pyx_n_u_MutableFst_topsort __pyx_string_tab[214]
#define __pyx_n_u_MutableFst_union __pyx_string_tab[215]
#define __pyx_n_u_MutableSymbolTable __pyx_string_tab[216]
#define __pyx_n_u_MutableSymbolTable_add_symbol __pyx_string_tab[217]
#define __pyx_n_u_MutableSymbolTable_add_table __pyx_string_tab[218]
#define __pyx_n_u_MutableSymbolTable_set_name __pyx_string_tab[219]
#define __pyx_n_u_NEG_TRINARY_PROPERTIES __pyx_string_tab[220]
#define __pyx_n_u_NON_I_DETERMINISTIC __pyx_string_tab[221]
#define __pyx_n_u_NON_O_DETERMINISTIC __pyx_string_tab[222]
#define __pyx_n_u_NOT_ACCEPTOR __pyx_string_tab[223]
#define __pyx_n_u_NOT_ACCESSIBLE __pyx_string_tab[224]
#define __pyx_n_u_NOT_COACCESSIBLE __pyx_string_tab[225]
#define __pyx_n_u_NOT_I_LABEL_SORTED __pyx_string_tab[226]
#define __pyx_n_u_NOT_O_LABEL_SORTED __pyx_string_tab[227]
#define __pyx_n_u_NOT_STRING __pyx_string_tab[228]
#define __pyx_n_u_NOT_TOP_SORTED __pyx_string_tab[229]
#define __pyx_n_u_NO_EPSILONS __pyx_string_tab[230]
#define __pyx_n_u_NO_I_EPSILONS __pyx_string_tab[231]
#define __pyx_n_u_NO_LABEL __pyx_string_tab[232]
#define __pyx_n_u_NO_O_EPSILONS __pyx_string_tab[233]
#define __pyx_n_u_NO_STATE_ID __pyx_string_tab[234]
#define __pyx_n_u_NO_SYMBOL __pyx_string_tab[235]
#define __pyx_n_u_NULL_PROPERTIES __pyx_string_tab[236]
#define __pyx_kp_u_No_new_SymbolTables_specified __pyx_string_tab[237]
#define __pyx_kp_u_No_relabeling_pairs_specified __pyx_string_tab[238]
#define __pyx_n_u_NotImplementedError __pyx_string_tab[239]
#define __pyx_kp_u_Note_that_Cython_is_deliberately __pyx_string_tab[240]
#define __pyx_n_u_Number __pyx_string_tab[241]
#define __pyx_n_u_O_DETERMINISTIC __pyx_string_tab[242]
#define __pyx_n_u_O_EPSILONS __pyx_string_tab[243]
#define __pyx_n_u_O_LABEL_INVARIANT_PROPERTIES __pyx_string_tab[244]
#define __pyx_n_u_O_LABEL_SORTED __pyx_string_tab[245]
#define __pyx_kp_u_Open_failed __pyx_string_tab[246]
#define __pyx_kp_u_Operation_failed __pyx_string_tab[247]
#define __pyx_n_u_PATH __pyx_string_tab[248]
#define __pyx_n_u_PIPE __pyx_string_tab[249]
#define __pyx_n_u_POS_TRINARY_PROPERTIES __pyx_string_tab[250]
#define __pyx_n_u_Popen __pyx_string_tab[251]
#define __pyx_n_u_ProjectType __pyx_string_tab[252]
#define __pyx_n_u_QueueType __pyx_string_tab[253]
#define __pyx_n_u_RIGHT_SEMIRING __pyx_string_tab[254]
#define __pyx_n_u_RM_SUPERFINAL_PROPERTIES __pyx_string_tab[255]
#define __pyx_n_u_RandArcSelection __pyx_string_tab[256]
#define __pyx_kp_u_Read_failed __pyx_string_tab[257]
#define __pyx_kp_u_Read_from_FST_failed __pyx_string_tab[258]
#define __pyx_kp_u_Read_from_string_failed __pyx_string_tab[259]
#define __pyx_n_u_RenderRequest __pyx_string_tab[260]
#define __pyx_kp_u_RenderServer_Render __pyx_string_tab[261]
#define __pyx_n_u_ReplaceLabelType __pyx_string_tab[262]
#define __pyx_n_u_ReweightType __pyx_string_tab[263]
#define __pyx_n_u_RuntimeError __pyx_string_tab[264]
#define __pyx_n_u_SEMIRING __pyx_string_tab[265]
#define __pyx_n_u_SET_ARC_PROPERTIES __pyx_string_tab[266]
#define __pyx_n_u_SET_FINAL_PROPERTIES __pyx_string_tab[267]
#define __pyx_n_u_SET_START_PROPERTIES __pyx_string_tab[268]
#define __pyx_n_u_STATE_SORT_PROPERTIES __pyx_string_tab[269]
#define __pyx_n_u_STRING __pyx_string_tab[270]
#define __pyx_n_u_SortType __pyx_string_tab[271]
#define __pyx_n_u_StateIterator __pyx_string_tab[272]
#define __pyx_n_u_StateIterator___reduce_cython __pyx_string_tab[273]
#define __pyx_n_u_StateIterator___setstate_cython __pyx_string_tab[274]
#define __pyx_kp_u_StateIterator_at_0x __pyx_string_tab[275]
#define __pyx_n_u_StateIterator_done __pyx_string_tab[276]
#define __pyx_n_u_StateIterator_next __pyx_string_tab[277]
#define __pyx_n_u_StateIterator_reset __pyx_string_tab[278]
#define __pyx_n_u_StateIterator_value __pyx_string_tab[279]
#define __pyx_n_u_StateMapType __pyx_string_tab[280]
#define __pyx_kp_u_State_index_out_of_range __pyx_string_tab[281]
#define __pyx_n_u_StopIteration __pyx_string_tab[282]
#define __pyx_kp_u_SymbolTable __pyx_string_tab[283]
#define __pyx_n_u_SymbolTableIterator __pyx_string_tab[284]
#define __pyx_n_u_SymbolTableIterator___reduce_cy __pyx_string_tab[285]
#define __pyx_n_u_SymbolTableIterator___setstate __pyx_string_tab[286]
#define __pyx_kp_u_SymbolTableIterator_at_0x __pyx_string_tab[287]
#define __pyx_n_u_SymbolTableView __pyx_string_tab[288]
#define __pyx_n_u_SymbolTableView___reduce __pyx_string_tab[289]
#define __pyx_n_u_SymbolTableView_available_key __pyx_string_tab[290]
#define __pyx_n_u_SymbolTableView_checksum __pyx_string_tab[291]
#define __pyx_n_u_SymbolTableView_copy __pyx_string_tab[292]
#define __pyx_n_u_SymbolTableView_find __pyx_string_tab[293]
#define __pyx_n_u_SymbolTableView_get_nth_key __pyx_string_tab[294]
#define __pyx_n_u_SymbolTableView_labeled_checksum __pyx_string_tab[295]
#define __pyx_n_u_SymbolTableView_member __pyx_string_tab[296]
#define __pyx_n_u_SymbolTableView_name __pyx_string_tab[297]
#define __pyx_n_u_SymbolTableView_num_symbols __pyx_string_tab[298]
#define __pyx_n_u_SymbolTableView_write __pyx_string_tab[299]
#define __pyx_n_u_SymbolTableView_write_text __pyx_string_tab[300]
#define __pyx_n_u_SymbolTableView_write_to_string __pyx_string_tab[301]
#define __pyx_n_u_SymbolTable_2 __pyx_string_tab[302]
#define __pyx_kp_u_SymbolTable_no_longer_exists __pyx_string_tab[303]
#define __pyx_n_u_SymbolTable_read __pyx_string_tab[304]
#define __pyx_n_u_SymbolTable_read_fst __pyx_string_tab[305]
#define __pyx_n_u_SymbolTable_read_text __pyx_string_tab[306]
#define __pyx_n_u_TOP_SORTED __pyx_string_tab[307]
#define __pyx_n_u_TRINARY_PROPERTIES __pyx_string_tab[308]
#define __pyx_kp_u_Tsvg_cairo __pyx_string_tab[309]
#define __pyx_n_u_TypeError __pyx_string_tab[310]
#define __pyx_n_u_UNWEIGHTED __pyx_string_tab[311]
#define __pyx_n_u_UNWEIGHTED_CYCLES __pyx_string_tab[312]
#define __pyx_kp_u_Unknown_FAR_type __pyx_string_tab[313]
#define __pyx_kp_u_Unknown_arc_type __pyx_string_tab[314]
#define __pyx_kp_u_Unknown_compose_filter_type __pyx_string_tab[315]
#define __pyx_kp_u_Unknown_determinization_type __pyx_string_tab[316]
#define __pyx_kp_u_Unknown_epsilon_normalization_ty __pyx_string_tab[317]
#define __pyx_kp_u_Unknown_map_type __pyx_string_tab[318]
#define __pyx_kp_u_Unknown_projection_type __pyx_string_tab[319]
#define __pyx_kp_u_Unknown_queue_type __pyx_string_tab[320]
#define __pyx_kp_u_Unknown_random_arc_selection_typ __pyx_string_tab[321]
#define __pyx_kp_u_Unknown_replace_label_type __pyx_string_tab[322]
#define __pyx_kp_u_Unknown_reweight_type __pyx_string_tab[323]
#define __pyx_kp_u_Unknown_sort_type __pyx_string_tab[324]
#define __pyx_n_u_ValueError __pyx_string_tab[325]
#define __pyx_n_u_VectorFst __pyx_string_tab[326]
#define __pyx_n_u_WEIGHTED __pyx_string_tab[327]
#define __pyx_n_u_WEIGHTED_CYCLES __pyx_string_tab[328]
#define __pyx_n_u_WEIGHT_INVARIANT_PROPERTIES __pyx_string_tab[329]
#define __pyx_kp_u_Weight __pyx_string_tab[330]
#define __pyx_n_u_WeightLike __pyx_string_tab[331]
#define __pyx_n_u_WeightProperties __pyx_string_tab[332]
#define __pyx_n_u_Weight_2 __pyx_string_tab[333]
#define __pyx_n_u_Weight___reduce_cython __pyx_string_tab[334]
#define __pyx_n_u_Weight___setstate_cython __pyx_string_tab[335]
#define __pyx_n_u_Weight_copy __pyx_string_tab[336]
#define __pyx_n_u_Weight_member __pyx_string_tab[337]
#define __pyx_n_u_Weight_no_weight __pyx_string_tab[338]
#define __pyx_n_u_Weight_one __pyx_string_tab[339]
#define __pyx_n_u_Weight_properties __pyx_string_tab[340]
#define __pyx_n_u_Weight_to_string __pyx_string_tab[341]
#define __pyx_n_u_Weight_type __pyx_string_tab[342]
#define __pyx_kp_u_Weight_type_not_found __pyx_string_tab[343]
#define __pyx_n_u_Weight_zero __pyx_string_tab[344]
#define __pyx_kp_u_Write_failed __pyx_string_tab[345]
#define __pyx_kp_u_Write_to_string_failed __pyx_string_tab[346]
#define __pyx_kp_u__2 __pyx_string_tab[347]
#define __pyx_kp_u__3 __pyx_string_tab[348]
#define __pyx_kp_u__4 __pyx_string_tab[349]
#define __pyx_kp_u__40 __pyx_string_tab[350]
#define __pyx_kp_u__41 __pyx_string_tab[351]
#define __pyx_kp_u__6 __pyx_string_tab[352]
#define __pyx_n_u_a __pyx_string_tab[353]
#define __pyx_n_u_acceptor __pyx_string_tab[354]
#define __pyx_n_u_add __pyx_string_tab[355]
#define __pyx_n_u_add_arc __pyx_string_tab[356]
#define __pyx_kp_u_add_note __pyx_string_tab[357]
#define __pyx_n_u_add_state __pyx_string_tab[358]
#define __pyx_n_u_add_states __pyx_string_tab[359]
#define __pyx_n_u_add_symbol __pyx_string_tab[360]
#define __pyx_n_u_add_table __pyx_string_tab[361]
#define __pyx_n_u_allow_nondet __pyx_string_tab[362]
#define __pyx_n_u_arc __pyx_string_tab[363]
#define __pyx_n_u_arc_type __pyx_string_tab[364]
#define __pyx_n_u_arc_type_2 __pyx_string_tab[365]
#define __pyx_n_u_arcmap __pyx_string_tab[366]
#define __pyx_n_u_arcs __pyx_string_tab[367]
#define __pyx_n_u_arcsort __pyx_string_tab[368]
#define __pyx_n_u_asyncio_coroutines __pyx_string_tab[369]
#define __pyx_kp_u_at_0x __pyx_string_tab[370]
#define __pyx_n_u_attach_new_isymbols __pyx_string_tab[371]
#define __pyx_n_u_attach_new_osymbols __pyx_string_tab[372]
#define __pyx_n_u_auto __pyx_string_tab[373]
#define __pyx_n_u_available_key __pyx_string_tab[374]
#define __pyx_kp_u_blade_graphviz_server __pyx_string_tab[375]
#define __pyx_kp_u_but_received __pyx_string_tab[376]
#define __pyx_n_u_call_arc_labeling __pyx_string_tab[377]
#define __pyx_n_u_checksum __pyx_string_tab[378]
#define __pyx_n_u_class __pyx_string_tab[379]
#define __pyx_n_u_class_2 __pyx_string_tab[380]
#define __pyx_n_u_cline_in_traceback __pyx_string_tab[381]
#define __pyx_n_u_closure __pyx_string_tab[382]
#define __pyx_n_u_closure_type __pyx_string_tab[383]
#define __pyx_n_u_cls __pyx_string_tab[384]
#define __pyx_n_u_colabtools __pyx_string_tab[385]
#define __pyx_n_u_communicate __pyx_string_tab[386]
#define __pyx_n_u_compact_symbol_table __pyx_string_tab[387]
#define __pyx_n_u_compile __pyx_string_tab[388]
#define __pyx_n_u_compose __pyx_string_tab[389]
#define __pyx_n_u_compose_filter __pyx_string_tab[390]
#define __pyx_n_u_concat __pyx_string_tab[391]
#define __pyx_n_u_connect __pyx_string_tab[392]
#define __pyx_kp_u_const_EncodeMapper_SymbolTableV __pyx_string_tab[393]
#define __pyx_kp_u_const_Fst_SymbolTableView __pyx_string_tab[394]
#define __pyx_n_u_convert __pyx_string_tab[395]
#define __pyx_n_u_copy __pyx_string_tab[396]
#define __pyx_n_u_create __pyx_string_tab[397]
#define __pyx_n_u_decode __pyx_string_tab[398]
#define __pyx_n_u_default __pyx_string_tab[399]
#define __pyx_n_u_delete_arcs __pyx_string_tab[400]
#define __pyx_n_u_delete_states __pyx_string_tab[401]
#define __pyx_n_u_delta __pyx_string_tab[402]
#define __pyx_n_u_det_type __pyx_string_tab[403]
#define __pyx_n_u_determinize __pyx_string_tab[404]
#define __pyx_n_u_dict __pyx_string_tab[405]
#define __pyx_n_u_difference __pyx_string_tab[406]
#define __pyx_kp_u_disable __pyx_string_tab[407]
#define __pyx_n_u_disambiguate __pyx_string_tab[408]
#define __pyx_n_u_distance __pyx_string_tab[409]
#define __pyx_n_u_divide __pyx_string_tab[410]
#define __pyx_n_u_doc __pyx_string_tab[411]
#define __pyx_n_u_done __pyx_string_tab[412]
#define __pyx_n_u_dot __pyx_string_tab[413]
#define __pyx_n_u_draw __pyx_string_tab[414]
#define __pyx_n_u_e __pyx_string_tab[415]
#define __pyx_kp_u_enable __pyx_string_tab[416]
#define __pyx_n_u_encode __pyx_string_tab[417]
#define __pyx_n_u_encode_labels __pyx_string_tab[418]
#define __pyx_n_u_encode_weights __pyx_string_tab[419]
#define __pyx_n_u_enum __pyx_string_tab[420]
#define __pyx_n_u_eps_norm_type __pyx_string_tab[421]
#define __pyx_n_u_epsilon_on_replace __pyx_string_tab[422]
#define __pyx_n_u_epsnormalize __pyx_string_tab[423]
#define __pyx_n_u_equal __pyx_string_tab[424]
#define __pyx_n_u_equivalent __pyx_string_tab[425]
#define __pyx_n_u_error __pyx_string_tab[426]
#define __pyx_n_u_expression __pyx_string_tab[427]
#define __pyx_kp_u_failed __pyx_string_tab[428]
#define __pyx_n_u_far_type __pyx_string_tab[429]
#define __pyx_n_u_far_type_2 __pyx_string_tab[430]
#define __pyx_n_u_final __pyx_string_tab[431]
#define __pyx_n_u_find __pyx_string_tab[432]
#define __pyx_n_u_flags __pyx_string_tab[433]
#define __pyx_n_u_flags_2 __pyx_string_tab[434]
#define __pyx_n_u_float_format __pyx_string_tab[435]
#define __pyx_n_u_fontsize __pyx_string_tab[436]
#define __pyx_n_u_format __pyx_string_tab[437]
#define __pyx_n_u_frontend __pyx_string_tab[438]
#define __pyx_n_u_fspath __pyx_string_tab[439]
#define __pyx_n_u_fst2 __pyx_string_tab[440]
#define __pyx_n_u_fst2_2 __pyx_string_tab[441]
#define __pyx_n_u_fst_type __pyx_string_tab[442]
#define __pyx_n_u_fsts2 __pyx_string_tab[443]
#define __pyx_n_u_fsts2_2 __pyx_string_tab[444]
#define __pyx_n_u_func __pyx_string_tab[445]
#define __pyx_n_u_functional __pyx_string_tab[446]
#define __pyx_n_u_g __pyx_string_tab[447]
#define __pyx_kp_u_gc __pyx_string_tab[448]
#define __pyx_n_u_get_fst __pyx_string_tab[449]
#define __pyx_n_u_get_key __pyx_string_tab[450]
#define __pyx_n_u_get_nth_key __pyx_string_tab[451]
#define __pyx_n_u_getstate __pyx_string_tab[452]
#define __pyx_n_u_google3_visualization_graphviz_s __pyx_string_tab[453]
#define __pyx_n_u_graph __pyx_string_tab[454]
#define __pyx_n_u_graphviz_server_pb2 __pyx_string_tab[455]
#define __pyx_n_u_height __pyx_string_tab[456]
#define __pyx_n_u_id __pyx_string_tab[457]
#define __pyx_n_u_identity __pyx_string_tab[458]
#define __pyx_n_u_ifst __pyx_string_tab[459]
#define __pyx_n_u_ifst1 __pyx_string_tab[460]
#define __pyx_n_u_ifst2 __pyx_string_tab[461]
#define __pyx_n_u_ilabel __pyx_string_tab[462]
#define __pyx_n_u_increment_subsequential_label __pyx_string_tab[463]
#define __pyx_n_u_initializing __pyx_string_tab[464]
#define __pyx_n_u_input __pyx_string_tab[465]
#define __pyx_n_u_input_symbols __pyx_string_tab[466]
#define __pyx_n_u_input_table __pyx_string_tab[467]
#define __pyx_n_u_intersect __pyx_string_tab[468]
#define __pyx_n_u_invert __pyx_string_tab[469]
#define __pyx_n_u_ipairs __pyx_string_tab[470]
#define __pyx_n_u_is_coroutine __pyx_string_tab[471]
#define __pyx_kp_u_isenabled __pyx_string_tab[472]
#define __pyx_n_u_isomorphic __pyx_string_tab[473]
#define __pyx_n_u_isymbols __pyx_string_tab[474]
#define __pyx_n_u_items __pyx_string_tab[475]
#define __pyx_n_u_keep_isymbols __pyx_string_tab[476]
#define __pyx_n_u_keep_osymbols __pyx_string_tab[477]
#define __pyx_n_u_keep_state_numbering __pyx_string_tab[478]
#define __pyx_n_u_key __pyx_string_tab[479]
#define __pyx_n_u_labeled_checksum __pyx_string_tab[480]
#define __pyx_n_u_lhs __pyx_string_tab[481]
#define __pyx_n_u_logging __pyx_string_tab[482]
#define __pyx_n_u_main __pyx_string_tab[483]
#define __pyx_n_u_map_type __pyx_string_tab[484]
#define __pyx_n_u_mapper __pyx_string_tab[485]
#define __pyx_n_u_mapper_2 __pyx_string_tab[486]
#define __pyx_n_u_mask __pyx_string_tab[487]
#define __pyx_n_u_mask_2 __pyx_string_tab[488]
#define __pyx_n_u_max_length __pyx_string_tab[489]
#define __pyx_n_u_member __pyx_string_tab[490]
#define __pyx_n_u_members __pyx_string_tab[491]
#define __pyx_n_u_merge_symbol_table __pyx_string_tab[492]
#define __pyx_n_u_metaclass __pyx_string_tab[493]
#define __pyx_n_u_minimize __pyx_string_tab[494]
#define __pyx_n_u_missing_sym __pyx_string_tab[495]
#define __pyx_n_u_module __pyx_string_tab[496]
#define __pyx_n_u_mro_entries __pyx_string_tab[497]
#define __pyx_n_u_mutable_arcs __pyx_string_tab[498]
#define __pyx_n_u_mutable_input_symbols __pyx_string_tab[499]
#define __pyx_n_u_mutable_output_symbols __pyx_string_tab[500]
#define __pyx_n_u_n __pyx_string_tab[501]
#define __pyx_n_u_name __pyx_string_tab[502]
#define __pyx_n_u_name_2 __pyx_string_tab[503]
#define __pyx_n_u_neither __pyx_string_tab[504]
#define __pyx_n_u_new_isymbols __pyx_string_tab[505]
#define __pyx_n_u_new_name __pyx_string_tab[506]
#define __pyx_n_u_new_osymbols __pyx_string_tab[507]
#define __pyx_n_u_next __pyx_string_tab[508]
#define __pyx_n_u_nextstate __pyx_string_tab[509]
#define __pyx_kp_u_no_default___reduce___due_to_non __pyx_string_tab[510]
#define __pyx_n_u_no_weight __pyx_string_tab[511]
#define __pyx_n_u_nodesep __pyx_string_tab[512]
#define __pyx_n_u_npath __pyx_string_tab[513]
#define __pyx_n_u_nshortest __pyx_string_tab[514]
#define __pyx_n_u_nstate __pyx_string_tab[515]
#define __pyx_n_u_num_arcs __pyx_string_tab[516]
#define __pyx_n_u_num_input_epsilons __pyx_string_tab[517]
#define __pyx_n_u_num_output_epsilons __pyx_string_tab[518]
#define __pyx_n_u_num_states __pyx_string_tab[519]
#define __pyx_n_u_num_states_if_known __pyx_string_tab[520]
#define __pyx_n_u_num_symbols __pyx_string_tab[521]
#define __pyx_n_u_numbers __pyx_string_tab[522]
#define __pyx_n_u_olabel __pyx_string_tab[523]
#define __pyx_n_u_old_isymbols __pyx_string_tab[524]
#define __pyx_n_u_old_osymbols __pyx_string_tab[525]
#define __pyx_n_u_one __pyx_string_tab[526]
#define __pyx_n_u_opairs __pyx_string_tab[527]
#define __pyx_n_u_open __pyx_string_tab[528]
#define __pyx_n_u_os __pyx_string_tab[529]
#define __pyx_n_u_osymbols __pyx_string_tab[530]
#define __pyx_n_u_output_symbols __pyx_string_tab[531]
#define __pyx_n_u_pairs __pyx_string_tab[532]
#define __pyx_n_u_plus __pyx_string_tab[533]
#define __pyx_n_u_pop __pyx_string_tab[534]
#define __pyx_n_u_portrait __pyx_string_tab[535]
#define __pyx_n_u_pos __pyx_string_tab[536]
#define __pyx_n_u_position __pyx_string_tab[537]
#define __pyx_n_u_potentials __pyx_string_tab[538]
#define __pyx_n_u_power __pyx_string_tab[539]
#define __pyx_n_u_precision __pyx_string_tab[540]
#define __pyx_n_u_prepare __pyx_string_tab[541]
#define __pyx_n_u_print __pyx_string_tab[542]
#define __pyx_n_u_project __pyx_string_tab[543]
#define __pyx_n_u_project_type __pyx_string_tab[544]
#define __pyx_n_u_properties __pyx_string_tab[545]
#define __pyx_n_u_props __pyx_string_tab[546]
#define __pyx_n_u_props_2 __pyx_string_tab[547]
#define __pyx_n_u_prune __pyx_string_tab[548]
#define __pyx_n_u_ptr __pyx_string_tab[549]
#define __pyx_n_u_push __pyx_string_tab[550]
#define __pyx_n_u_push_labels __pyx_string_tab[551]
#define __pyx_n_u_push_weights __pyx_string_tab[552]
#define __pyx_n_u_pywrapfst_2 __pyx_string_tab[553]
#define __pyx_kp_u_pywrapfst_pyx __pyx_string_tab[554]
#define __pyx_n_u_pyx_state __pyx_string_tab[555]
#define __pyx_n_u_pyx_vtable __pyx_string_tab[556]
#define __pyx_n_u_qualname __pyx_string_tab[557]
#define __pyx_n_u_queue_type __pyx_string_tab[558]
#define __pyx_n_u_randequivalent __pyx_string_tab[559]
#define __pyx_n_u_randgen __pyx_string_tab[560]
#define __pyx_n_u_ranksep __pyx_string_tab[561]
#define __pyx_n_u_raw __pyx_string_tab[562]
#define __pyx_n_u_read __pyx_string_tab[563]
#define __pyx_n_u_read_EncodeMapper_from_string __pyx_string_tab[564]
#define __pyx_n_u_read_Fst __pyx_string_tab[565]
#define __pyx_n_u_read_Fst_from_string __pyx_string_tab[566]
#define __pyx_n_u_read_SymbolTable_from_string __pyx_string_tab[567]
#define __pyx_n_u_read_from_string __pyx_string_tab[568]
#define __pyx_n_u_read_fst __pyx_string_tab[569]
#define __pyx_n_u_read_text __pyx_string_tab[570]
#define __pyx_n_u_reader __pyx_string_tab[571]
#define __pyx_n_u_reduce __pyx_string_tab[572]
#define __pyx_n_u_reduce_cython __pyx_string_tab[573]
#define __pyx_n_u_reduce_ex __pyx_string_tab[574]
#define __pyx_n_u_relabel_pairs __pyx_string_tab[575]
#define __pyx_n_u_relabel_tables __pyx_string_tab[576]
#define __pyx_n_u_remove_common_affix __pyx_string_tab[577]
#define __pyx_n_u_remove_total_weight __pyx_string_tab[578]
#define __pyx_n_u_rendered_bytes __pyx_string_tab[579]
#define __pyx_n_u_rendered_graph __pyx_string_tab[580]
#define __pyx_n_u_replace __pyx_string_tab[581]
#define __pyx_n_u_repr_svg __pyx_string_tab[582]
#define __pyx_n_u_require_superinitial __pyx_string_tab[583]
#define __pyx_n_u_reserve_arcs __pyx_string_tab[584]
#define __pyx_n_u_reserve_states __pyx_string_tab[585]
#define __pyx_n_u_reset __pyx_string_tab[586]
#define __pyx_n_u_result __pyx_string_tab[587]
#define __pyx_n_u_result_2 __pyx_string_tab[588]
#define __pyx_n_u_return_arc_labeling __pyx_string_tab[589]
#define __pyx_n_u_return_bytes __pyx_string_tab[590]
#define __pyx_n_u_return_label __pyx_string_tab[591]
#define __pyx_n_u_reverse __pyx_string_tab[592]
#define __pyx_n_u_reweight __pyx_string_tab[593]
#define __pyx_n_u_reweight_type __pyx_string_tab[594]
#define __pyx_n_u_rhs __pyx_string_tab[595]
#define __pyx_n_u_rmepsilon __pyx_string_tab[596]
#define __pyx_n_u_seed __pyx_string_tab[597]
#define __pyx_n_u_seek __pyx_string_tab[598]
#define __pyx_n_u_select __pyx_string_tab[599]
#define __pyx_n_u_self __pyx_string_tab[600]
#define __pyx_kp_u_self__arc_cannot_be_converted_to __pyx_string_tab[601]
#define __pyx_kp_u_self__fst_self__it_cannot_be_con __pyx_string_tab[602]
#define __pyx_kp_u_self__fst_self__it_self__mfst_se __pyx_string_tab[603]
#define __pyx_kp_u_self__it_cannot_be_converted_to __pyx_string_tab[604]
#define __pyx_kp_u_self__reader_cannot_be_converted __pyx_string_tab[605]
#define __pyx_kp_u_self__weight_cannot_be_converted __pyx_string_tab[606]
#define __pyx_kp_u_self__writer_cannot_be_converted __pyx_string_tab[607]
#define __pyx_n_u_sep __pyx_string_tab[608]
#define __pyx_n_u_sep_2 __pyx_string_tab[609]
#define __pyx_n_u_set_final __pyx_string_tab[610]
#define __pyx_n_u_set_flags __pyx_string_tab[611]
#define __pyx_n_u_set_input_symbols __pyx_string_tab[612]
#define __pyx_n_u_set_name __pyx_string_tab[613]
#define __pyx_n_u_set_name_2 __pyx_string_tab[614]
#define __pyx_n_u_set_output_symbols __pyx_string_tab[615]
#define __pyx_n_u_set_properties __pyx_string_tab[616]
#define __pyx_n_u_set_start __pyx_string_tab[617]
#define __pyx_n_u_set_value __pyx_string_tab[618]
#define __pyx_n_u_setstate __pyx_string_tab[619]
#define __pyx_n_u_setstate_cython __pyx_string_tab[620]
#define __pyx_n_u_shortestdistance __pyx_string_tab[621]
#define __pyx_n_u_shortestpath __pyx_string_tab[622]
#define __pyx_n_u_show_weight_one __pyx_string_tab[623]
#define __pyx_n_u_sort_type __pyx_string_tab[624]
#define __pyx_n_u_source __pyx_string_tab[625]
#define __pyx_n_u_source_2 __pyx_string_tab[626]
#define __pyx_n_u_sources __pyx_string_tab[627]
#define __pyx_n_u_sources_2 __pyx_string_tab[628]
#define __pyx_n_u_spec __pyx_string_tab[629]
#define __pyx_n_u_sstrm __pyx_string_tab[630]
#define __pyx_n_u_ssymbols __pyx_string_tab[631]
#define __pyx_n_u_standard __pyx_string_tab[632]
#define __pyx_n_u_star __pyx_string_tab[633]
#define __pyx_n_u_start __pyx_string_tab[634]
#define __pyx_n_u_state __pyx_string_tab[635]
#define __pyx_n_u_statemap __pyx_string_tab[636]
#define __pyx_n_u_states __pyx_string_tab[637]
#define __pyx_n_u_staticmethod __pyx_string_tab[638]
#define __pyx_n_u_stdin __pyx_string_tab[639]
#define __pyx_n_u_stdout __pyx_string_tab[640]
#define __pyx_kp_u_stringsource __pyx_string_tab[641]
#define __pyx_n_u_stubby __pyx_string_tab[642]
#define __pyx_n_u_subprocess __pyx_string_tab[643]
#define __pyx_n_u_subsequential_label __pyx_string_tab[644]
#define __pyx_n_u_symbol __pyx_string_tab[645]
#define __pyx_n_u_symbols __pyx_string_tab[646]
#define __pyx_n_u_symbols_2 __pyx_string_tab[647]
#define __pyx_n_u_synchronize __pyx_string_tab[648]
#define __pyx_n_u_sys __pyx_string_tab[649]
#define __pyx_n_u_test __pyx_string_tab[650]
#define __pyx_n_u_test_2 __pyx_string_tab[651]
#define __pyx_n_u_tfar __pyx_string_tab[652]
#define __pyx_n_u_times __pyx_string_tab[653]
#define __pyx_n_u_title __pyx_string_tab[654]
#define __pyx_n_u_to_initial __pyx_string_tab[655]
#define __pyx_n_u_to_string __pyx_string_tab[656]
#define __pyx_n_u_topsort __pyx_string_tab[657]
#define __pyx_n_u_type __pyx_string_tab[658]
#define __pyx_n_u_typing __pyx_string_tab[659]
#define __pyx_kp_u_typing_Literal_alt_sequence_auto __pyx_string_tab[660]
#define __pyx_kp_u_typing_Literal_arc_sum_arc_uniqu __pyx_string_tab[661]
#define __pyx_kp_u_typing_Literal_auto_fifo_lifo_sh __pyx_string_tab[662]
#define __pyx_kp_u_typing_Literal_e_f_g __pyx_string_tab[663]
#define __pyx_kp_u_typing_Literal_fst_stlist_sttabl __pyx_string_tab[664]
#define __pyx_kp_u_typing_Literal_functional_nonfun __pyx_string_tab[665]
#define __pyx_kp_u_typing_Literal_identity_input_ep __pyx_string_tab[666]
#define __pyx_kp_u_typing_Literal_ilabel_olabel __pyx_string_tab[667]
#define __pyx_kp_u_typing_Literal_input_output __pyx_string_tab[668]
#define __pyx_kp_u_typing_Literal_neither_input_out __pyx_string_tab[669]
#define __pyx_kp_u_typing_Literal_to_initial_to_fin __pyx_string_tab[670]
#define __pyx_kp_u_typing_Literal_uniform_log_prob __pyx_string_tab[671]
#define __pyx_kp_u_typing_Union_Weight_typing_Union __pyx_string_tab[672]
#define __pyx_n_u_uniform __pyx_string_tab[673]
#define __pyx_n_u_union __pyx_string_tab[674]
#define __pyx_n_u_unique __pyx_string_tab[675]
#define __pyx_n_u_unknown_isymbol __pyx_string_tab[676]
#define __pyx_n_u_unknown_osymbol __pyx_string_tab[677]
#define __pyx_kp_u_unspecified __pyx_string_tab[678]
#define __pyx_n_u_value __pyx_string_tab[679]
#define __pyx_n_u_vector __pyx_string_tab[680]
#define __pyx_n_u_verify __pyx_string_tab[681]
#define __pyx_n_u_vertical __pyx_string_tab[682]
#define __pyx_n_u_w __pyx_string_tab[683]
#define __pyx_n_u_warning __pyx_string_tab[684]
#define __pyx_n_u_weight __pyx_string_tab[685]
#define __pyx_n_u_weight_2 __pyx_string_tab[686]
#define __pyx_n_u_weight_type __pyx_string_tab[687]
#define __pyx_n_u_weighted __pyx_string_tab[688]
#define __pyx_n_u_width __pyx_string_tab[689]
#define __pyx_n_u_write __pyx_string_tab[690]
#define __pyx_n_u_write_text __pyx_string_tab[691]
#define __pyx_n_u_write_to_string __pyx_string_tab[692]
#define __pyx_n_u_writer __pyx_string_tab[693]
#define __pyx_n_u_x __pyx_string_tab[694]
#define __pyx_n_u_zero __pyx_string_tab[695]
/* #### Code section: module_state_clear ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __Pyx_State_RemoveModule(NULL);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_Weight);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_Weight);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_SymbolTableView);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_SymbolTableView);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst__EncodeMapperSymbolTableView);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst__FstSymbolTableView);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst__FstSymbolTableView);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst__MutableSymbolTable);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst__MutableSymbolTable);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst__MutableFstSymbolTableView);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_SymbolTable);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_SymbolTable);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst__SymbolTableIterator);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst__SymbolTableIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_EncodeMapper);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_EncodeMapper);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_Fst);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_Fst);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_MutableFst);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_MutableFst);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_VectorFst);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_VectorFst);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_Arc);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_Arc);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst__ArcIterator);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst__ArcIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst__MutableArcIterator);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst__MutableArcIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst__StateIterator);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst__StateIterator);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_Compiler);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_Compiler);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_FarReader);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_FarReader);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst_FarWriter);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst_FarWriter);
  Py_CLEAR(clear_module_state->__pyx_ptype_9pywrapfst___pyx_defaults);
  Py_CLEAR(clear_module_state->__pyx_type_9pywrapfst___pyx_defaults);
  for (int i=0; i<17; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  for (int i=0; i<185; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<696; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  Py_CLEAR(clear_module_state->__pyx_float_1_);
  Py_CLEAR(clear_module_state->__pyx_float_0_4);
  Py_CLEAR(clear_module_state->__pyx_float_8_5);
  Py_CLEAR(clear_module_state->__pyx_float_0_25);
  Py_CLEAR(clear_module_state->__pyx_float_11_0);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_5);
  Py_CLEAR(clear_module_state->__pyx_int_14);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_Weight);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_Weight);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_SymbolTableView);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_SymbolTableView);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst__EncodeMapperSymbolTableView);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst__FstSymbolTableView);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst__FstSymbolTableView);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst__MutableSymbolTable);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst__MutableSymbolTable);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst__MutableFstSymbolTableView);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_SymbolTable);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_SymbolTable);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst__SymbolTableIterator);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst__SymbolTableIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_EncodeMapper);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_EncodeMapper);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_Fst);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_Fst);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_MutableFst);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_MutableFst);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_VectorFst);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_VectorFst);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_Arc);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_Arc);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst__ArcIterator);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst__ArcIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst__MutableArcIterator);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst__MutableArcIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst__StateIterator);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst__StateIterator);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_Compiler);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_Compiler);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_FarReader);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_FarReader);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst_FarWriter);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst_FarWriter);
  Py_VISIT(traverse_module_state->__pyx_ptype_9pywrapfst___pyx_defaults);
  Py_VISIT(traverse_module_state->__pyx_type_9pywrapfst___pyx_defaults);
  for (int i=0; i<17; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  for (int i=0; i<185; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  for (int i=0; i<696; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_1_);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_4);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_8_5);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_0_25);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_float_11_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_0);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_1);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_5);
  __Pyx_VISIT_CONST(traverse_module_state->__pyx_int_14);
  return 0;
}
#endif
/* #### Code section: module_code ### */

/* "string.from_py":12
 *     cdef const char* __Pyx_PyObject_AsStringAndSize(object, Py_ssize_t*) except NULL
 * 
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
*/

static std::string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char const *__pyx_v_data;
  std::string __pyx_r;
  char const *__pyx_t_1;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "string.from_py":14
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0             # <<<<<<<<<<<<<<
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)
*/
  __pyx_v_length = 0;

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, length)
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)0))) __PYX_ERR(1, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length = 0
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  try {
    __pyx_t_2 = std::string(__pyx_v_data, __pyx_v_length);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(1, 16, __pyx_L1_error)
  }
  __pyx_r = __pyx_t_2;
  goto __pyx_L0;

  /* "string.from_py":12
 *     cdef const char* __Pyx_PyObject_AsStringAndSize(object, Py_ssize_t*) except NULL
 * 
 * @cname("__pyx_convert_string_from_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef string __pyx_convert_string_from_py_6libcpp_6string_std__in_string(object o) except *:
 *     cdef Py_ssize_t length = 0
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_6libcpp_6string_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  return __pyx_r;
}

/* "string.to_py":30
 *     cdef object __Pyx_PyObject_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":32
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_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":30
 *     cdef object __Pyx_PyObject_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyObject_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_6libcpp_6string_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":36
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":38
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     return __Pyx_PyUnicode_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_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":36
 *     cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_6libcpp_6string_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":42
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":44
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_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, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":42
 *     cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_6libcpp_6string_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":48
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(const string& s):
 *     return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
*/

static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string(std::string const &__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string", 0);

  /* "string.to_py":50
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_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, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "string.to_py":48
 *     cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
 * 
 * @cname("__pyx_convert_PyByteArray_string_to_py_6libcpp_6string_std__in_string")             # <<<<<<<<<<<<<<
 * cdef inline object __pyx_convert_PyByteArray_string_to_py_6libcpp_6string_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_6libcpp_6string_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":48
 *     cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
 * 
 * @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 *:
 * 
*/

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;
  Py_ssize_t __pyx_v_s;
  PyObject *__pyx_v_item = NULL;
  std::vector<std::string>  __pyx_r;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_string", 0);

  /* "vector.from_py":52
 * 
 *     cdef vector[X] v
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)             # <<<<<<<<<<<<<<
 * 
 *     if s > 0:
*/
  __pyx_t_1 = __Pyx_PyObject_LengthHint(__pyx_v_o, 0); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 52, __pyx_L1_error)
  __pyx_v_s = __pyx_t_1;

  /* "vector.from_py":54
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
 * 
 *     if s > 0:             # <<<<<<<<<<<<<<
 *         v.reserve(<size_t> s)
 * 
*/
  __pyx_t_2 = (__pyx_v_s > 0);
  if (__pyx_t_2) {

    /* "vector.from_py":55
 * 
 *     if s > 0:
 *         v.reserve(<size_t> s)             # <<<<<<<<<<<<<<
 * 
 *     for item in o:
*/
    try {
      __pyx_v_v.reserve(((size_t)__pyx_v_s));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 55, __pyx_L1_error)
    }

    /* "vector.from_py":54
 *     cdef Py_ssize_t s = __Pyx_PyObject_LengthHint(o, 0)
 * 
 *     if s > 0:             # <<<<<<<<<<<<<<
 *         v.reserve(<size_t> s)
 * 
*/
  }

  /* "vector.from_py":57
 *         v.reserve(<size_t> s)
 * 
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 * 
*/
  if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
    __pyx_t_3 = __pyx_v_o; __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 57, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 57, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_3, __pyx_t_1);
        ++__pyx_t_1;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_3);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(1, 57, __pyx_L1_error)
          #endif
          if (__pyx_t_1 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_3, __pyx_t_1);
        #endif
        ++__pyx_t_1;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 57, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_3);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(1, 57, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "vector.from_py":58
 * 
 *     for item in o:
 *         v.push_back(<X>item)             # <<<<<<<<<<<<<<
 * 
 *     return v
*/
    __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
    try {
      __pyx_v_v.push_back(((std::string)__pyx_t_6));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(1, 58, __pyx_L1_error)
    }

    /* "vector.from_py":57
 *         v.reserve(<size_t> s)
 * 
 *     for item in o:             # <<<<<<<<<<<<<<
 *         v.push_back(<X>item)
 * 
*/
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "vector.from_py":60
 *         v.push_back(<X>item)
 * 
 *     return v             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_v;
  goto __pyx_L0;

  /* "vector.from_py":48
 *     cdef Py_ssize_t __Pyx_PyObject_LengthHint(object o, Py_ssize_t defaultval) except -1
 * 
 * @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 *:
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __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;
}

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

static std::string __pyx_f_9pywrapfst_tostring(PyObject *__pyx_v_data) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9[6];
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("tostring", 0);

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

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

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

  /* "pywrapfst.pyx":210
 *   if isinstance(data, str):
 *     return data
 *   raise TypeError(f"Expected {str.__name__} but received "             # <<<<<<<<<<<<<<
 *                   f"{type(data).__name__}: {data!r}")
 * 
*/
  __pyx_t_4 = NULL;
  __Pyx_INCREF(__pyx_builtin_TypeError);
  __pyx_t_5 = __pyx_builtin_TypeError; 
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pywrapfst.pyx":211
 *     return data
 *   raise TypeError(f"Expected {str.__name__} but received "
 *                   f"{type(data).__name__}: {data!r}")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_data), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Expected;
  __pyx_t_9[1] = __pyx_t_7;
  __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_but_received;
  __pyx_t_9[3] = __pyx_t_8;
  __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_9[5] = __pyx_t_6;

  /* "pywrapfst.pyx":210
 *   if isinstance(data, str):
 *     return data
 *   raise TypeError(f"Expected {str.__name__} but received "             # <<<<<<<<<<<<<<
 *                   f"{type(data).__name__}: {data!r}")
 * 
*/
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_9, 6, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_10};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  }
  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __PYX_ERR(0, 210, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __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":214
 * 
 * 
 * cdef string weight_tostring(data) except *:             # <<<<<<<<<<<<<<
 *   """Converts strings or numerics to bytestrings.
 * 
*/

static std::string __pyx_f_9pywrapfst_weight_tostring(PyObject *__pyx_v_data) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::string __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9[6];
  PyObject *__pyx_t_10 = NULL;
  size_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weight_tostring", 0);

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

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

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

  /* "pywrapfst.pyx":238
 *   if isinstance(data, str):
 *     return data
 *   elif isinstance(data, numbers.Number):             # <<<<<<<<<<<<<<
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "
*/
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_numbers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Number); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_data, __pyx_t_4); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":239
 *     return data
 *   elif isinstance(data, numbers.Number):
 *     return str(data)             # <<<<<<<<<<<<<<
 *   raise TypeError(f"Expected {str.__name__} but received "
 *                   f"{type(data).__name__}: {data!r}")
*/
    __pyx_t_4 = __Pyx_PyObject_Unicode(__pyx_v_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 239, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_2;
    goto __pyx_L0;

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

  /* "pywrapfst.pyx":240
 *   elif isinstance(data, numbers.Number):
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "             # <<<<<<<<<<<<<<
 *                   f"{type(data).__name__}: {data!r}")
 * 
*/
  __pyx_t_3 = NULL;
  __Pyx_INCREF(__pyx_builtin_TypeError);
  __pyx_t_5 = __pyx_builtin_TypeError; 
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)(&PyUnicode_Type)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "pywrapfst.pyx":241
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "
 *                   f"{type(data).__name__}: {data!r}")             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(__pyx_v_data)), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_8 = __Pyx_PyObject_FormatSimple(__pyx_t_6, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_data), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_9[0] = __pyx_mstate_global->__pyx_kp_u_Expected;
  __pyx_t_9[1] = __pyx_t_7;
  __pyx_t_9[2] = __pyx_mstate_global->__pyx_kp_u_but_received;
  __pyx_t_9[3] = __pyx_t_8;
  __pyx_t_9[4] = __pyx_mstate_global->__pyx_kp_u_;
  __pyx_t_9[5] = __pyx_t_6;

  /* "pywrapfst.pyx":240
 *   elif isinstance(data, numbers.Number):
 *     return str(data)
 *   raise TypeError(f"Expected {str.__name__} but received "             # <<<<<<<<<<<<<<
 *                   f"{type(data).__name__}: {data!r}")
 * 
*/
  __pyx_t_10 = __Pyx_PyUnicode_Join(__pyx_t_9, 6, 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_8) + 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_8) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_10};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_11, (2-__pyx_t_11) | (__pyx_t_11*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __PYX_ERR(0, 240, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __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":244
 * 
 * 
 * cdef string path_tostring(data) except *:             # <<<<<<<<<<<<<<
 *   return tostring(os.fspath(data))
 * 
*/

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

  /* "pywrapfst.pyx":245
 * 
 * cdef string path_tostring(data) except *:
 *   return tostring(os.fspath(data))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_fspath); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_data};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

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

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

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

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

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

    /* "pywrapfst.pyx":269
 *   cdef fst.FarType _far_type
 *   if not fst.GetFarType(far_type, addr(_far_type)):
 *     raise FstArgError(f"Unknown FAR type: {far_type!r}")             # <<<<<<<<<<<<<<
 *   return _far_type
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_far_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_FAR_type, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 269, __pyx_L1_error)

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

  /* "pywrapfst.pyx":270
 *   if not fst.GetFarType(far_type, addr(_far_type)):
 *     raise FstArgError(f"Unknown FAR type: {far_type!r}")
 *   return _far_type             # <<<<<<<<<<<<<<
 * 
 * cdef fst.ClosureType _get_closure_type(const string &closure_type) except *:
*/
  __pyx_r = __pyx_v__far_type;
  goto __pyx_L0;

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

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

/* "pywrapfst.pyx":272
 *   return _far_type
 * 
 * cdef fst.ClosureType _get_closure_type(const string &closure_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate ClosureType enum value.
 * 
*/

static enum fst::ClosureType __pyx_f_9pywrapfst__get_closure_type(std::string const &__pyx_v_closure_type) {
  enum fst::ClosureType __pyx_v__closure_type;
  enum fst::ClosureType __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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_closure_type", 0);

  /* "pywrapfst.pyx":288
 *   """
 *   cdef fst.ClosureType _closure_type
 *   if not fst.GetClosureType(closure_type, addr(_closure_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown projection type: {closure_type!r}")
 *   return _closure_type
*/
  __pyx_t_1 = (!(fst::script::GetClosureType(__pyx_v_closure_type, (&__pyx_v__closure_type)) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":289
 *   cdef fst.ClosureType _closure_type
 *   if not fst.GetClosureType(closure_type, addr(_closure_type)):
 *     raise FstArgError(f"Unknown projection type: {closure_type!r}")             # <<<<<<<<<<<<<<
 *   return _closure_type
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_closure_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_projection_type, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 289, __pyx_L1_error)

    /* "pywrapfst.pyx":288
 *   """
 *   cdef fst.ClosureType _closure_type
 *   if not fst.GetClosureType(closure_type, addr(_closure_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown projection type: {closure_type!r}")
 *   return _closure_type
*/
  }

  /* "pywrapfst.pyx":290
 *   if not fst.GetClosureType(closure_type, addr(_closure_type)):
 *     raise FstArgError(f"Unknown projection type: {closure_type!r}")
 *   return _closure_type             # <<<<<<<<<<<<<<
 * 
 * cdef fst.ComposeFilter _get_compose_filter(
*/
  __pyx_r = __pyx_v__closure_type;
  goto __pyx_L0;

  /* "pywrapfst.pyx":272
 *   return _far_type
 * 
 * cdef fst.ClosureType _get_closure_type(const string &closure_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate ClosureType 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_AddTraceback("pywrapfst._get_closure_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::ClosureType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":292
 *   return _closure_type
 * 
 * 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 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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_compose_filter", 0);

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

    /* "pywrapfst.pyx":315
 *   cdef fst.ComposeFilter _compose_filter
 *   if not fst.GetComposeFilter(compose_filter, addr(_compose_filter)):
 *     raise FstArgError(f"Unknown compose filter type: {compose_filter!r}")             # <<<<<<<<<<<<<<
 *   return _compose_filter
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_compose_filter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_compose_filter_type, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 315, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 315, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":292
 *   return _closure_type
 * 
 * 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_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":319
 * 
 * 
 * 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 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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_determinize_type", 0);

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

    /* "pywrapfst.pyx":336
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(det_type, addr(_det_type)):
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")             # <<<<<<<<<<<<<<
 *   return _det_type
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_det_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_determinization_type, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 336, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":319
 * 
 * 
 * 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_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":339
 *   return _det_type
 * 
 * cdef fst.EpsNormalizeType _get_eps_norm_type(             # <<<<<<<<<<<<<<
 *     const string &eps_norm_type) except *:
 *   """Matches string with the appropriate EpsNormalizeType enum value.
*/

static enum fst::EpsNormalizeType __pyx_f_9pywrapfst__get_eps_norm_type(std::string const &__pyx_v_eps_norm_type) {
  enum fst::EpsNormalizeType __pyx_v__eps_norm_type;
  enum fst::EpsNormalizeType __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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_eps_norm_type", 0);

  /* "pywrapfst.pyx":356
 *   """
 *   cdef fst.EpsNormalizeType _eps_norm_type
 *   if not fst.GetEpsNormalizeType(eps_norm_type, addr(_eps_norm_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown epsilon normalization type: {eps_norm_type!r}")
 *   return _eps_norm_type
*/
  __pyx_t_1 = (!(fst::script::GetEpsNormalizeType(__pyx_v_eps_norm_type, (&__pyx_v__eps_norm_type)) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":357
 *   cdef fst.EpsNormalizeType _eps_norm_type
 *   if not fst.GetEpsNormalizeType(eps_norm_type, addr(_eps_norm_type)):
 *     raise FstArgError(f"Unknown epsilon normalization type: {eps_norm_type!r}")             # <<<<<<<<<<<<<<
 *   return _eps_norm_type
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_eps_norm_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_epsilon_normalization_ty, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 357, __pyx_L1_error)

    /* "pywrapfst.pyx":356
 *   """
 *   cdef fst.EpsNormalizeType _eps_norm_type
 *   if not fst.GetEpsNormalizeType(eps_norm_type, addr(_eps_norm_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown epsilon normalization type: {eps_norm_type!r}")
 *   return _eps_norm_type
*/
  }

  /* "pywrapfst.pyx":358
 *   if not fst.GetEpsNormalizeType(eps_norm_type, addr(_eps_norm_type)):
 *     raise FstArgError(f"Unknown epsilon normalization type: {eps_norm_type!r}")
 *   return _eps_norm_type             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v__eps_norm_type;
  goto __pyx_L0;

  /* "pywrapfst.pyx":339
 *   return _det_type
 * 
 * cdef fst.EpsNormalizeType _get_eps_norm_type(             # <<<<<<<<<<<<<<
 *     const string &eps_norm_type) except *:
 *   """Matches string with the appropriate EpsNormalizeType 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_AddTraceback("pywrapfst._get_eps_norm_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::EpsNormalizeType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

    /* "pywrapfst.pyx":378
 *   cdef fst.ProjectType _project_type
 *   if not fst.GetProjectType(project_type, addr(_project_type)):
 *     raise FstArgError(f"Unknown projection type: {project_type!r}")             # <<<<<<<<<<<<<<
 *   return _project_type
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_project_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_projection_type, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 378, __pyx_L1_error)

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

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

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

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

/* "pywrapfst.pyx":382
 * 
 * 
 * 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 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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_queue_type", 0);

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

    /* "pywrapfst.pyx":402
 *   cdef fst.QueueType _queue_type
 *   if not fst.GetQueueType(queue_type, addr(_queue_type)):
 *     raise FstArgError(f"Unknown queue type: {queue_type!r}")             # <<<<<<<<<<<<<<
 *   return _queue_type
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_queue_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_queue_type, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 402, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":382
 * 
 * 
 * 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_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":406
 * 
 * 
 * cdef fst.RandArcSelection _get_rand_arc_selection(             # <<<<<<<<<<<<<<
 *     const string &select) except *:
 *   """Matches string with the appropriate RandArcSelection enum value.
*/

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

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

    /* "pywrapfst.pyx":427
 *   cdef fst.RandArcSelection _select
 *   if not fst.GetRandArcSelection(select, addr(_select)):
 *     raise FstArgError(f"Unknown random arc selection type: {select!r}")             # <<<<<<<<<<<<<<
 *   return _select
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_select); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_random_arc_selection_typ, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 427, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":406
 * 
 * 
 * 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_AddTraceback("pywrapfst._get_rand_arc_selection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (fst::script::RandArcSelection) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":431
 * 
 * 
 * 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 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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_replace_label_type", 0);

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

    /* "pywrapfst.pyx":455
 *                                  epsilon_on_replace,
 *                                  addr(_replace_label_type)):
 *     raise FstArgError(f"Unknown replace label type: {replace_label_type!r}")             # <<<<<<<<<<<<<<
 *   return _replace_label_type
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_replace_label_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_replace_label_type, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 455, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 455, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":431
 * 
 * 
 * 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_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":459
 * 
 * 
 * cdef fst.ReweightType _get_reweight_type(const string &reweight_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate ReweightType enum value.
 * 
*/

static enum fst::ReweightType __pyx_f_9pywrapfst__get_reweight_type(std::string const &__pyx_v_reweight_type) {
  enum fst::ReweightType __pyx_v__reweight_type;
  enum fst::ReweightType __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;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_reweight_type", 0);

  /* "pywrapfst.pyx":475
 *   """
 *   cdef fst.ReweightType _reweight_type
 *   if not fst.GetReweightType(reweight_type, addr(_reweight_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown reweight type: {reweight_type!r}")
 *   return _reweight_type
*/
  __pyx_t_1 = (!(fst::script::GetReweightType(__pyx_v_reweight_type, (&__pyx_v__reweight_type)) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":476
 *   cdef fst.ReweightType _reweight_type
 *   if not fst.GetReweightType(reweight_type, addr(_reweight_type)):
 *     raise FstArgError(f"Unknown reweight type: {reweight_type!r}")             # <<<<<<<<<<<<<<
 *   return _reweight_type
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_reweight_type); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_reweight_type, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_7 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 476, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 476, __pyx_L1_error)

    /* "pywrapfst.pyx":475
 *   """
 *   cdef fst.ReweightType _reweight_type
 *   if not fst.GetReweightType(reweight_type, addr(_reweight_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown reweight type: {reweight_type!r}")
 *   return _reweight_type
*/
  }

  /* "pywrapfst.pyx":477
 *   if not fst.GetReweightType(reweight_type, addr(_reweight_type)):
 *     raise FstArgError(f"Unknown reweight type: {reweight_type!r}")
 *   return _reweight_type             # <<<<<<<<<<<<<<
 * 
 * ## Weight and helpers.
*/
  __pyx_r = __pyx_v__reweight_type;
  goto __pyx_L0;

  /* "pywrapfst.pyx":459
 * 
 * 
 * cdef fst.ReweightType _get_reweight_type(const string &reweight_type) except *:             # <<<<<<<<<<<<<<
 *   """Matches string with the appropriate ReweightType 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_AddTraceback("pywrapfst._get_reweight_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = (enum fst::ReweightType) 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":502
 *   """
 * 
 *   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
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  bool __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_weight", 0);

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

    /* "pywrapfst.pyx":504
 *   cdef void _check_weight(self) except *:
 *     if self.type() == b"none":
 *       raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *     if not self.member():
 *       raise FstBadWeightError("Invalid weight")
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Weight_type_not_found};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 504, __pyx_L1_error)

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

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

    /* "pywrapfst.pyx":506
 *       raise FstArgError("Weight type not found")
 *     if not self.member():
 *       raise FstBadWeightError("Invalid weight")             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, weight_type, weight):
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstBadWeightError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_Invalid_weight};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 506, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 506, __pyx_L1_error)

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

  /* "pywrapfst.pyx":502
 *   """
 * 
 *   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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.Weight._check_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":508
 *       raise FstBadWeightError("Invalid weight")
 * 
 *   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_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_6Weight_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_weight_type = 0;
  PyObject *__pyx_v_weight = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_weight_type,&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 508, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 508, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 508, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 508, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 508, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 508, __pyx_L3_error)
    }
    __pyx_v_weight_type = values[0];
    __pyx_v_weight = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 508, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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___init__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self), __pyx_v_weight_type, __pyx_v_weight);

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

static int __pyx_pf_9pywrapfst_6Weight___init__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, PyObject *__pyx_v_weight_type, PyObject *__pyx_v_weight) {
  int __pyx_r;
  std::string __pyx_t_1;
  std::string __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

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

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

  /* "pywrapfst.pyx":509
 * 
 *   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":511
 *     self._weight.reset(new fst.WeightClass(tostring(weight_type),
 *                                            weight_tostring(weight)))
 *     self._check_weight()             # <<<<<<<<<<<<<<
 * 
 *   cpdef Weight copy(self):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_weight");
    __PYX_ERR(0, 511, __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, 511, __pyx_L1_error)

  /* "pywrapfst.pyx":508
 *       raise FstBadWeightError("Invalid weight")
 * 
 *   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:;
  return __pyx_r;
}

/* "pywrapfst.pyx":513
 *     self._check_weight()
 * 
 *   cpdef Weight copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
*/

static PyObject *__pyx_pw_9pywrapfst_6Weight_3copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_6Weight_3copy)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 513, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

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

  /* "pywrapfst.pyx":521
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(deref(self._weight)))
 *     return _weight             # <<<<<<<<<<<<<<
 * 
 *   cpdef string type(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v__weight);
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "pywrapfst.pyx":513
 *     self._check_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__weight);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_3copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_6Weight_2copy, "\n    copy(self)\n\n    Returns a copy of the Weight.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_3copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_3copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_2copy};
static PyObject *__pyx_pw_9pywrapfst_6Weight_3copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_2copy(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_2copy(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_6Weight_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __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":523
 *     return _weight
 * 
 *   cpdef string type(self):             # <<<<<<<<<<<<<<
 *     """type(self)
 * 
*/

static PyObject *__pyx_pw_9pywrapfst_6Weight_5type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_6Weight_5type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

  /* "pywrapfst.pyx":523
 *     return _weight
 * 
 *   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_AddTraceback("pywrapfst.Weight.type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_5type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_6Weight_4type, "type(self)\n\n    Returns a string indicating the weight type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_5type = {"type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_5type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_4type};
static PyObject *__pyx_pw_9pywrapfst_6Weight_5type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("type", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_4type(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_4type(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_6Weight_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 523, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __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.Weight.type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":530
 *     return self._weight.get().Type()
 * 
 *   cpdef string to_string(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().ToString()
 * 
*/

static PyObject *__pyx_pw_9pywrapfst_6Weight_7to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_6Weight_7to_string)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

  /* "pywrapfst.pyx":530
 *     return self._weight.get().Type()
 * 
 *   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_AddTraceback("pywrapfst.Weight.to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_7to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_7to_string = {"to_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_7to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_6Weight_7to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("to_string", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("to_string", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_6to_string(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_6to_string(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_6Weight_to_string(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __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.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":533
 *     return self._weight.get().ToString()
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_9__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_9__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_8__repr__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_8__repr__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __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[7];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":534
 * 
 *   def __repr__(self):
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __str__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "type");
    __PYX_ERR(0, 534, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->type(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 534, __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'", "to_string");
    __PYX_ERR(0, 534, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 534, __pyx_L1_error)
  __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_Format(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_6[1] = __pyx_t_2;
  __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_Weight;
  __pyx_t_6[3] = __pyx_t_3;
  __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_6[5] = __pyx_t_5;
  __pyx_t_6[6] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_4 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 8 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5));
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":533
 *     return self._weight.get().ToString()
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":536
 *     return f"<{self.type()} Weight {self.to_string()} at 0x{id(self):x}>"
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.to_string()
 * 
*/

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

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_10__str__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":542
 *   # ValueError when that is not appropriate.
 * 
 *   def __float__(self):             # <<<<<<<<<<<<<<
 *     return float(self.to_string())
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_13__float__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_13__float__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__float__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_12__float__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_12__float__(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__float__", 0);

  /* "pywrapfst.pyx":543
 * 
 *   def __float__(self):
 *     return float(self.to_string())             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool member(self):
*/
  __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, 543, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v_self->__pyx_vtab)->to_string(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 543, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Float(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __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":545
 *     return float(self.to_string())
 * 
 *   cpdef bool member(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().Member()
 * 
*/

static PyObject *__pyx_pw_9pywrapfst_6Weight_15member(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static bool __pyx_f_9pywrapfst_6Weight_member(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self, int __pyx_skip_dispatch) {
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("member", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_6Weight_15member)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

  /* "pywrapfst.pyx":545
 *     return float(self.to_string())
 * 
 *   cpdef bool member(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().Member()
 * 
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_15member(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_15member = {"member", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_15member, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_6Weight_15member(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("member (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("member", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("member", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_14member(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_14member(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("member", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_6Weight_member(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __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.Weight.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":548
 *     return self._weight.get().Member()
 * 
 *   def properties(self):             # <<<<<<<<<<<<<<
 *     """properties(self)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_17properties(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_6Weight_16properties, "properties(self)\n\n    Returns the weight's properties.\n\n    Returns:\n      A bitmask.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_17properties = {"properties", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_17properties, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_16properties};
static PyObject *__pyx_pw_9pywrapfst_6Weight_17properties(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("properties (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("properties", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("properties", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_16properties(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_16properties(struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  uint64_t __pyx_v__props;
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("properties", 0);

  /* "pywrapfst.pyx":557
 *     """
 *     cdef uint64_t _props
 *     with nogil:             # <<<<<<<<<<<<<<
 *      _props = self._weight.get().Properties()
 *     return WeightProperties(_props)
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":558
 *     cdef uint64_t _props
 *     with nogil:
 *      _props = self._weight.get().Properties()             # <<<<<<<<<<<<<<
 *     return WeightProperties(_props)
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 558, __pyx_L4_error)
        }
        __pyx_v__props = __pyx_v_self->_weight.get()->Properties();
      }

      /* "pywrapfst.pyx":557
 *     """
 *     cdef uint64_t _props
 *     with nogil:             # <<<<<<<<<<<<<<
 *      _props = self._weight.get().Properties()
 *     return WeightProperties(_props)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":559
 *     with nogil:
 *      _props = self._weight.get().Properties()
 *     return WeightProperties(_props)             # <<<<<<<<<<<<<<
 * 
 *   def __eq__(Weight w1, Weight w2):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_WeightProperties); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_uint64_t(__pyx_v__props); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":548
 *     return self._weight.get().Member()
 * 
 *   def properties(self):             # <<<<<<<<<<<<<<
 *     """properties(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.properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":561
 *     return WeightProperties(_props)
 * 
 *   def __eq__(Weight w1, Weight w2):             # <<<<<<<<<<<<<<
 *     return fst.Eq(deref(w1._weight), deref(w2._weight))
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_19__eq__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_19__eq__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__eq__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 561, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_18__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;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_6Weight_18__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__eq__", 0);

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

  /* "pywrapfst.pyx":561
 *     return WeightProperties(_props)
 * 
 *   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":564
 *     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_21__ne__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_6Weight_21__ne__(PyObject *__pyx_v_w1, PyObject *__pyx_v_w2) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__ne__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "w2", 0))) __PYX_ERR(0, 564, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_20__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;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_6Weight_20__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__ne__", 0);

  /* "pywrapfst.pyx":565
 * 
 *   def __ne__(Weight w1, Weight w2):
 *     return not w1 == w2             # <<<<<<<<<<<<<<
 * 
 *   # To get around the inability to declare cdef class methods, we define the
*/
  __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, 565, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 565, __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, 565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":564
 *     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":570
 *   # C++ part out-of-class and then call it from within.
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def zero(cls, weight_type):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_23zero(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_6Weight_22zero, "\n    Weight.zero(weight_type)\n\n    Constructs semiring zero.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_23zero = {"zero", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_23zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_22zero};
static PyObject *__pyx_pw_9pywrapfst_6Weight_23zero(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_weight_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zero (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_weight_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 570, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 570, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "zero", 0) < 0) __PYX_ERR(0, 570, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("zero", 1, 1, 1, i); __PYX_ERR(0, 570, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 570, __pyx_L3_error)
    }
    __pyx_v_weight_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zero", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 570, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Weight.zero", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_22zero(((PyTypeObject*)__pyx_v_cls), __pyx_v_weight_type);

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_22zero(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("zero", 0);

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

  /* "pywrapfst.pyx":570
 *   # C++ part out-of-class and then call it from within.
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def zero(cls, 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":579
 *     return _zero(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def one(cls, weight_type):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_25one(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_6Weight_24one, "\n    Weight.one(weight_type)\n\n    Constructs semiring One.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_25one = {"one", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_25one, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_24one};
static PyObject *__pyx_pw_9pywrapfst_6Weight_25one(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_weight_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("one (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_weight_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 579, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "one", 0) < 0) __PYX_ERR(0, 579, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("one", 1, 1, 1, i); __PYX_ERR(0, 579, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 579, __pyx_L3_error)
    }
    __pyx_v_weight_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("one", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 579, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Weight.one", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_24one(((PyTypeObject*)__pyx_v_cls), __pyx_v_weight_type);

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_24one(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("one", 0);

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

  /* "pywrapfst.pyx":579
 *     return _zero(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def one(cls, 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":588
 *     return _one(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def no_weight(cls, weight_type):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_6Weight_27no_weight(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_6Weight_26no_weight, "\n    Weight.no_weight(weight_type)\n\n    Constructs a non-member weight in the semiring.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_27no_weight = {"no_weight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_27no_weight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_26no_weight};
static PyObject *__pyx_pw_9pywrapfst_6Weight_27no_weight(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_weight_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("no_weight (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_weight_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 588, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 588, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "no_weight", 0) < 0) __PYX_ERR(0, 588, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("no_weight", 1, 1, 1, i); __PYX_ERR(0, 588, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 588, __pyx_L3_error)
    }
    __pyx_v_weight_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("no_weight", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 588, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Weight.no_weight", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_26no_weight(((PyTypeObject*)__pyx_v_cls), __pyx_v_weight_type);

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_26no_weight(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_weight_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("no_weight", 0);

  /* "pywrapfst.pyx":595
 *     Constructs a non-member weight in the semiring.
 *     """
 *     return _no_weight(weight_type)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__no_weight(__pyx_v_weight_type)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":588
 *     return _one(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def no_weight(cls, weight_type):
 *     """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pywrapfst.Weight.no_weight", __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_29__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_29__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_6Weight_29__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_28__reduce_cython__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_28__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_Weight *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 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_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__weight_cannot_be_converted, 0, 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_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_31__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_6Weight_31__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_6Weight_31__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Weight.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_6Weight_30__setstate_cython__(((struct __pyx_obj_9pywrapfst_Weight *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_9pywrapfst_6Weight_30__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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._weight cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._weight cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__weight_cannot_be_converted, 0, 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_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":598
 * 
 * 
 * cdef Weight _plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
*/

static struct __pyx_obj_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__weight = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_plus", 0);

  /* "pywrapfst.pyx":599
 * 
 * cdef Weight _plus(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(fst.Plus(deref(lhs._weight),
 *                                                      deref(rhs._weight))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 599, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_1plus(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_1plus, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_plus};
static PyObject *__pyx_pw_9pywrapfst_1plus(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("plus (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lhs,&__pyx_mstate_global->__pyx_n_u_rhs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 605, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 605, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 605, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "plus", 0) < 0) __PYX_ERR(0, 605, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, i); __PYX_ERR(0, 605, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 605, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 605, __pyx_L3_error)
    }
    __pyx_v_lhs = ((struct __pyx_obj_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_9pywrapfst_Weight *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("plus", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 605, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 605, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 605, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("plus", 0);

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

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

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

  /* "pywrapfst.pyx":605
 * 
 * 
 * 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__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static struct __pyx_obj_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__weight = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_times", 0);

  /* "pywrapfst.pyx":631
 * 
 * cdef Weight _times(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(fst.Times(deref(lhs._weight),
 *                                                       deref(rhs._weight))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 631, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3times(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3times, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_2times};
static PyObject *__pyx_pw_9pywrapfst_3times(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("times (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lhs,&__pyx_mstate_global->__pyx_n_u_rhs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 637, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 637, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "times", 0) < 0) __PYX_ERR(0, 637, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, i); __PYX_ERR(0, 637, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 637, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 637, __pyx_L3_error)
    }
    __pyx_v_lhs = ((struct __pyx_obj_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_9pywrapfst_Weight *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("times", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 637, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 637, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 637, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("times", 0);

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

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

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

  /* "pywrapfst.pyx":637
 * 
 * 
 * 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__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static struct __pyx_obj_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__weight = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_divide", 0);

  /* "pywrapfst.pyx":663
 * 
 * cdef Weight _divide(Weight lhs, Weight rhs):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(fst.Divide(deref(lhs._weight),
 *                                                        deref(rhs._weight))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_5divide(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_5divide, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_4divide};
static PyObject *__pyx_pw_9pywrapfst_5divide(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_lhs = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_rhs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("divide (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lhs,&__pyx_mstate_global->__pyx_n_u_rhs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 669, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 669, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 669, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "divide", 0) < 0) __PYX_ERR(0, 669, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, i); __PYX_ERR(0, 669, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 669, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 669, __pyx_L3_error)
    }
    __pyx_v_lhs = ((struct __pyx_obj_9pywrapfst_Weight *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_9pywrapfst_Weight *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("divide", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 669, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "lhs", 0))) __PYX_ERR(0, 669, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "rhs", 0))) __PYX_ERR(0, 669, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("divide", 0);

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

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

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

  /* "pywrapfst.pyx":669
 * 
 * 
 * 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__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static struct __pyx_obj_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__weight = 0;
  struct __pyx_obj_9pywrapfst_Weight *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_power", 0);

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

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_7power(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_7power, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6power};
static PyObject *__pyx_pw_9pywrapfst_7power(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v_w = 0;
  size_t __pyx_v_n;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("power (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_w,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 702, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 702, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 702, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "power", 0) < 0) __PYX_ERR(0, 702, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, i); __PYX_ERR(0, 702, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 702, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 702, __pyx_L3_error)
    }
    __pyx_v_w = ((struct __pyx_obj_9pywrapfst_Weight *)values[0]);
    __pyx_v_n = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 702, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("power", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 702, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Weight, 1, "w", 0))) __PYX_ERR(0, 702, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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__weight = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("power", 0);

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

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

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

  /* "pywrapfst.pyx":702
 * 
 * 
 * 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__weight);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":724
 * 
 * 
 * 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__weight;
  fst::script::WeightClass __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::string __pyx_t_2;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_WeightClass_or_zero", 0);

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

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

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

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

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

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

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

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

      /* "pywrapfst.pyx":749
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if not _weight.Member():
 *       raise FstBadWeightError(weight_tostring(weight))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 749, __pyx_L1_error)
      __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 749, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 749, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":724
 * 
 * 
 * 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":753
 * 
 * 
 * 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__weight;
  fst::script::WeightClass __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  std::string __pyx_t_2;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_WeightClass_or_one", 0);

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

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

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

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

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

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

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

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

      /* "pywrapfst.pyx":778
 *     _weight = fst.WeightClass(weight_type, weight_tostring(weight))
 *     if not _weight.Member():
 *       raise FstBadWeightError(weight_tostring(weight))             # <<<<<<<<<<<<<<
 *   return _weight
 * 
*/
      __pyx_t_4 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstBadWeightError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 778, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __pyx_f_9pywrapfst_weight_tostring(__pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 778, __pyx_L1_error)
      __pyx_t_6 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 778, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
        assert(__pyx_t_4);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_6};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 778, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 778, __pyx_L1_error)

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

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

  /* "pywrapfst.pyx":753
 * 
 * 
 * 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_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":782
 * 
 * 
 * cdef Weight _zero(weight_type):             # <<<<<<<<<<<<<<
 *   cdef Weight _weight = Weight.__new__(Weight)
 *   _weight._weight.reset(
*/

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__zero(PyObject *__pyx_v_weight_type) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_zero", 0);

  /* "pywrapfst.pyx":783
 * 
 * cdef Weight _zero(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 783, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

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

    /* "pywrapfst.pyx":787
 *     new fst.WeightClass(fst.WeightClass.Zero(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *   return _weight
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Weight_type_not_found};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 787, __pyx_L1_error)

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

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

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

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

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

static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst__one(PyObject *__pyx_v_weight_type) {
  struct __pyx_obj_9pywrapfst_Weight *__pyx_v__weight = 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;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_one", 0);

  /* "pywrapfst.pyx":792
 * 
 * cdef Weight _one(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 792, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

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

    /* "pywrapfst.pyx":796
 *     new fst.WeightClass(fst.WeightClass.One(tostring(weight_type))))
 *   if _weight._weight.get().Type() == b"none":
 *     raise FstArgError("Weight type not found")             # <<<<<<<<<<<<<<
 *   return _weight
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Weight_type_not_found};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 796, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 796, __pyx_L1_error)

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

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

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

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

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

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

  /* "pywrapfst.pyx":801
 * 
 * cdef Weight _no_weight(weight_type):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(
 *     new fst.WeightClass(fst.WeightClass.NoWeight(tostring(weight_type))))
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 801, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

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

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

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

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

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

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

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

/* Python wrapper */
static int __pyx_pw_9pywrapfst_15SymbolTableView_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_15SymbolTableView_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView___init__(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static int __pyx_pf_9pywrapfst_15SymbolTableView___init__(struct __pyx_obj_9pywrapfst_SymbolTableView *__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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":837
 * 
 *   def __init__(self):
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *   def __iter__(self):
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_t_3 = __pyx_builtin_NotImplementedError; 
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Cannot_construct, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 837, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 837, __pyx_L1_error)

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

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

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

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

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_2__iter__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "pywrapfst.pyx":840
 * 
 *   def __iter__(self):
 *     return _SymbolTableIterator(self)             # <<<<<<<<<<<<<<
 * 
 *   # Registers the class for pickling.
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__SymbolTableIterator);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__SymbolTableIterator); 
  __pyx_t_4 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 840, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_5__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_4__reduce__(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_4__reduce__(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pywrapfst.pyx":845
 * 
 *   def __reduce__(self):
 *     return (_read_SymbolTable_from_string, (self.write_to_string(),))             # <<<<<<<<<<<<<<
 * 
 *   # Returns a raw const pointer to SymbolTable.
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_read_SymbolTable_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 845, __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, 845, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 845, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 845, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 845, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

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

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

static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_15SymbolTableView__raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;

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

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

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

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

static void __pyx_f_9pywrapfst_15SymbolTableView__raise_nonexistent(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_raise_nonexistent", 0);

  /* "pywrapfst.pyx":856
 *   # Raises an FstOpError for a nonexistent SymbolTable.
 *   cdef void _raise_nonexistent(self) except *:
 *     raise FstOpError("SymbolTable no longer exists")             # <<<<<<<<<<<<<<
 * 
 *   # Internal API method that should be used when a const pointer to an
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_4 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_SymbolTable_no_longer_exists};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (2-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 856, __pyx_L1_error)

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

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

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

static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_15SymbolTableView__raw_ptr_or_raise(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v__raw;
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

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

  /* "pywrapfst.pyx":862
 *   cdef const_SymbolTable_ptr _raw_ptr_or_raise(self) except *:
 *     cdef const_SymbolTable_ptr _raw = self._raw()
 *     if _raw == NULL:             # <<<<<<<<<<<<<<
 *       self._raise_nonexistent()
 *     return _raw
*/
  __pyx_t_2 = (__pyx_v__raw == NULL);
  if (__pyx_t_2) {

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

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

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

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

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

/* "pywrapfst.pyx":866
 *     return _raw
 * 
 *   cpdef int64_t available_key(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     available_key(self)
*/

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int64_t __pyx_f_9pywrapfst_15SymbolTableView_available_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  int64_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;
  int64_t __pyx_t_6;
  fst::SymbolTable const *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("available_key", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_available_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 866, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_7available_key)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 866, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

  /* "pywrapfst.pyx":866
 *     return _raw
 * 
 *   cpdef int64_t available_key(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     available_key(self)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_6available_key, "\n    available_key(self)\n\n    Returns an integer indicating the next available key index in the table.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_7available_key = {"available_key", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_7available_key, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_6available_key};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_7available_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("available_key (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("available_key", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("available_key", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_6available_key(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_6available_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("available_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_available_key(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 866, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __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.SymbolTableView.available_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("checksum", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_9checksum)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 874, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_8checksum, "\n    checksum(self)\n\n    Returns a bytestring indicating the label-independent MD5 checksum.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_9checksum = {"checksum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_9checksum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_8checksum};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_9checksum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("checksum (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("checksum", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("checksum", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_8checksum(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_8checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("checksum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 874, __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.SymbolTableView.checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_15SymbolTableView_copy(struct __pyx_obj_9pywrapfst_SymbolTableView *__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;
  size_t __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_11copy)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable))))) __PYX_ERR(0, 882, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":888
 *     Returns a mutable copy of the SymbolTable.
 *     """
 *     return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))             # <<<<<<<<<<<<<<
 * 
 *   def find(self, key):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 888, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L1_error)
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(fst::WrapUnique<fst::SymbolTable>(__pyx_t_6->Copy()))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 888, __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":882
 *     return self._raw_ptr_or_raise().CheckSum()
 * 
 *   cpdef SymbolTable copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_10copy, "\n    copy(self)\n\n    Returns a mutable copy of the SymbolTable.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_11copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_11copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_10copy};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_11copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_10copy(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_10copy(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_15SymbolTableView_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __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.SymbolTableView.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_13find(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_12find, "\n    find(self, key)\n\n    Given a symbol or index, finds the other one.\n\n    This method returns the index associated with a symbol key, or the symbol\n    associated with a index key.\n\n    Args:\n      key: Either a string or an index.\n\n    Returns:\n      If the key is a string, the associated index or NO_LABEL if not found; if\n          the key is an integer, the associated symbol or an empty string if\n          not found.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_13find = {"find", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_13find, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_12find};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_13find(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("find (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 890, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 890, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "find", 0) < 0) __PYX_ERR(0, 890, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("find", 1, 1, 1, i); __PYX_ERR(0, 890, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 890, __pyx_L3_error)
    }
    __pyx_v_key = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("find", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 890, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.SymbolTableView.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_12find(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), __pyx_v_key);

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

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

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

  /* "pywrapfst.pyx":908
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.FindIndex(tostring(key))
 *     except TypeError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

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

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

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

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

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

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

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

/* "pywrapfst.pyx":913
 *       return _raw.FindSymbol(key)
 * 
 *   cpdef int64_t get_nth_key(self, ssize_t pos) except *:             # <<<<<<<<<<<<<<
 *     """
 *     get_nth_key(self, pos)
*/

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int64_t __pyx_f_9pywrapfst_15SymbolTableView_get_nth_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos, int __pyx_skip_dispatch) {
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int64_t __pyx_t_7;
  fst::SymbolTable const *__pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_nth_key", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_get_nth_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = PyLong_FromSsize_t(__pyx_v_pos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 913, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_7 = __Pyx_PyLong_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 913, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

  /* "pywrapfst.pyx":913
 *       return _raw.FindSymbol(key)
 * 
 *   cpdef int64_t get_nth_key(self, ssize_t pos) except *:             # <<<<<<<<<<<<<<
 *     """
 *     get_nth_key(self, pos)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_14get_nth_key, "\n    get_nth_key(self, pos)\n\n    Retrieves the integer index of the n-th key in the table.\n\n    Args:\n      pos: The n-th key to retrieve.\n\n    Returns:\n      The integer index of the n-th key, or NO_LABEL if not found.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_15get_nth_key = {"get_nth_key", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_14get_nth_key};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_15get_nth_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  Py_ssize_t __pyx_v_pos;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_nth_key (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pos,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 913, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 913, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "get_nth_key", 0) < 0) __PYX_ERR(0, 913, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("get_nth_key", 1, 1, 1, i); __PYX_ERR(0, 913, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 913, __pyx_L3_error)
    }
    __pyx_v_pos = PyLong_AsSsize_t(values[0]); if (unlikely((__pyx_v_pos == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("get_nth_key", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 913, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.SymbolTableView.get_nth_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_14get_nth_key(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), __pyx_v_pos);

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_14get_nth_key(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, Py_ssize_t __pyx_v_pos) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_nth_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_get_nth_key(__pyx_v_self, __pyx_v_pos, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 913, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __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.SymbolTableView.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":927
 *     return self._raw_ptr_or_raise().GetNthKey(pos)
 * 
 *   cpdef bytes labeled_checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     labeled_checksum(self)
*/

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("labeled_checksum", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_labeled_checksum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 927, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 927, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_16labeled_checksum, "\n    labeled_checksum(self)\n\n    Returns a bytestring indicating the label-dependent MD5 checksum.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_17labeled_checksum = {"labeled_checksum", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_16labeled_checksum};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_17labeled_checksum(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("labeled_checksum (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("labeled_checksum", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("labeled_checksum", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_16labeled_checksum(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_16labeled_checksum(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("labeled_checksum", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __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.SymbolTableView.labeled_checksum", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static bool __pyx_f_9pywrapfst_15SymbolTableView_member(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v__raw;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  fst::SymbolTable const *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  std::string __pyx_t_11;
  int __pyx_t_12;
  int64_t __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("member", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_member); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_19member)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

  /* "pywrapfst.pyx":952
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_8);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    /*try:*/ {

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

      /* "pywrapfst.pyx":952
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:
*/
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

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

      /* "pywrapfst.pyx":955
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:
 *       return _raw.MemberIndex(key)             # <<<<<<<<<<<<<<
 * 
 *   cpdef string name(self) except *:
*/
      __pyx_t_13 = __Pyx_PyLong_As_int64_t(__pyx_v_key); if (unlikely((__pyx_t_13 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 955, __pyx_L5_except_error)
      __pyx_r = __pyx_v__raw->Member(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;

    /* "pywrapfst.pyx":952
 *     """
 *     cdef const_SymbolTable_ptr _raw = self._raw_ptr_or_raise()
 *     try:             # <<<<<<<<<<<<<<
 *       return _raw.MemberSymbol(tostring(key))
 *     except TypeError:
*/
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
    goto __pyx_L0;
  }

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_18member, "\n    member(self, key)\n\n    Given a symbol or index, returns whether it is found in the table.\n\n    This method returns a boolean indicating whether the given symbol or index\n    is present in the table. If one intends to perform subsequent lookup, it is\n    better to simply call the find method, catching the KeyError.\n\n    Args:\n      key: Either a string or an index.\n\n    Returns:\n      Whether or not the key is present (as a string or a index) in the table.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_19member = {"member", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_19member, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_18member};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_19member(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("member (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 935, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 935, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "member", 0) < 0) __PYX_ERR(0, 935, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("member", 1, 1, 1, i); __PYX_ERR(0, 935, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 935, __pyx_L3_error)
    }
    __pyx_v_key = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("member", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 935, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.SymbolTableView.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_18member(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), __pyx_v_key);

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_18member(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("member", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_member(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __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.SymbolTableView.member", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static std::string __pyx_f_9pywrapfst_15SymbolTableView_name(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  fst::SymbolTable const *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("name", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 957, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_21name)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_20name, "\n    name(self)\n\n    Returns the symbol table's name.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_21name = {"name", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_21name, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_20name};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_21name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("name", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("name", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_20name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_20name(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("name", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_name(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 957, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __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.SymbolTableView.name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_9pywrapfst_15SymbolTableView_num_symbols(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_22num_symbols, "\n    num_symbols(self)\n\n    Returns the number of symbols in the symbol table.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_23num_symbols = {"num_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_22num_symbols};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_23num_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_symbols", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_symbols", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_22num_symbols(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_22num_symbols(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_num_symbols(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __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.SymbolTableView.num_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_15SymbolTableView_write(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_ptr;
  std::string __pyx_v__source;
  bool __pyx_v__result;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  std::string __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_25write)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_source};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":987
 *       FstIOError: Write failed.
 *     """
 *     cdef const_SymbolTable_ptr ptr = self._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef string _source = path_tostring(source)
 *     cdef bool _result
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 987, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 987, __pyx_L1_error)
  __pyx_v_ptr = __pyx_t_6;

  /* "pywrapfst.pyx":988
 *     """
 *     cdef const_SymbolTable_ptr ptr = self._raw_ptr_or_raise()
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/
  __pyx_t_7 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 988, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pywrapfst.pyx":990
 *     cdef string _source = path_tostring(source)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ptr.Write(_source)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":991
 *     cdef bool _result
 *     with nogil:
 *       _result = ptr.Write(_source)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIOError(f"Write failed: {source!r}")
*/
        __pyx_v__result = __pyx_v_ptr->Write(__pyx_v__source);
      }

      /* "pywrapfst.pyx":990
 *     cdef string _source = path_tostring(source)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ptr.Write(_source)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":992
 *     with nogil:
 *       _result = ptr.Write(_source)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
*/
  __pyx_t_8 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_8)) {

    /* "pywrapfst.pyx":993
 *       _result = ptr.Write(_source)
 *     if not _result:
 *       raise FstIOError(f"Write failed: {source!r}")             # <<<<<<<<<<<<<<
 * 
 *   def write_text(self, source, *, sep="\t "):
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 993, __pyx_L1_error)

    /* "pywrapfst.pyx":992
 *     with nogil:
 *       _result = ptr.Write(_source)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
*/
  }

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_24write, "\n    write(self, source)\n\n    Serializes symbol table to a file.\n\n    This methods writes the SymbolTable to a file in binary format.\n\n    Args:\n      source: The string location of the output file.\n\n    Raises:\n      FstIOError: Write failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_25write = {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_25write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_24write};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_25write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 973, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 973, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "write", 0) < 0) __PYX_ERR(0, 973, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, i); __PYX_ERR(0, 973, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 973, __pyx_L3_error)
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 973, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.SymbolTableView.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_24write(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), __pyx_v_source);

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_24write(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_15SymbolTableView_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 973, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __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.SymbolTableView.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":995
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   def write_text(self, source, *, sep="\t "):             # <<<<<<<<<<<<<<
 *     """
 *     write_text(self, source, *, sep="\t ")
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_27write_text(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_26write_text, "\n    write_text(self, source, *, sep=\"\t \")\n\n    Writes symbol table to text file.\n\n    This method writes the SymbolTable to a file in human-readable format.\n\n    Args:\n      source: The string location of the output file.\n      sep: Characters to be used as a separator between fields in a textual\n          SymbolTable file, encoded as a string. Only the first byte is used.\n\n    Raises:\n      FstIOError: Write failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_27write_text = {"write_text", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_27write_text, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_26write_text};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_27write_text(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_sep = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_text (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,&__pyx_mstate_global->__pyx_n_u_sep,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 995, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "write_text", 0) < 0) __PYX_ERR(0, 995, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__4));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write_text", 1, 1, 1, i); __PYX_ERR(0, 995, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 995, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__4));
    }
    __pyx_v_source = values[0];
    __pyx_v_sep = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write_text", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 995, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.SymbolTableView.write_text", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_26write_text(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), __pyx_v_source, __pyx_v_sep);

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_26write_text(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, PyObject *__pyx_v_source, PyObject *__pyx_v_sep) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_ptr;
  std::string __pyx_v__source;
  std::string __pyx_v__sep;
  bool __pyx_v__result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_text", 0);

  /* "pywrapfst.pyx":1011
 *       FstIOError: Write failed.
 *     """
 *     cdef const_SymbolTable_ptr ptr = self._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef string _source = path_tostring(source)
 *     cdef string _sep = tostring(sep)
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1011, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1011, __pyx_L1_error)
  __pyx_v_ptr = __pyx_t_1;

  /* "pywrapfst.pyx":1012
 *     """
 *     cdef const_SymbolTable_ptr ptr = self._raw_ptr_or_raise()
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     cdef string _sep = tostring(sep)
 *     cdef bool _result
*/
  __pyx_t_2 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1012, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pywrapfst.pyx":1013
 *     cdef const_SymbolTable_ptr ptr = self._raw_ptr_or_raise()
 *     cdef string _source = path_tostring(source)
 *     cdef string _sep = tostring(sep)             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/
  __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_sep); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1013, __pyx_L1_error)
  __pyx_v__sep = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pywrapfst.pyx":1015
 *     cdef string _sep = tostring(sep)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ptr.WriteText(_source, _sep)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1016
 *     cdef bool _result
 *     with nogil:
 *       _result = ptr.WriteText(_source, _sep)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIOError(f"Write failed: {source!r}")
*/
        __pyx_v__result = __pyx_v_ptr->WriteText(__pyx_v__source, __pyx_v__sep);
      }

      /* "pywrapfst.pyx":1015
 *     cdef string _sep = tostring(sep)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ptr.WriteText(_source, _sep)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1017
 *     with nogil:
 *       _result = ptr.WriteText(_source, _sep)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
*/
  __pyx_t_3 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_3)) {

    /* "pywrapfst.pyx":1018
 *       _result = ptr.WriteText(_source, _sep)
 *     if not _result:
 *       raise FstIOError(f"Write failed: {source!r}")             # <<<<<<<<<<<<<<
 * 
 *   cpdef bytes write_to_string(self):
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Write_failed, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1018, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1018, __pyx_L1_error)

    /* "pywrapfst.pyx":1017
 *     with nogil:
 *       _result = ptr.WriteText(_source, _sep)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
*/
  }

  /* "pywrapfst.pyx":995
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   def write_text(self, source, *, sep="\t "):             # <<<<<<<<<<<<<<
 *     """
 *     write_text(self, source, *, sep="\t ")
*/

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

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

static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_9pywrapfst_15SymbolTableView_write_to_string(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self, int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_ptr;
  bool __pyx_v__result;
  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;
  size_t __pyx_t_5;
  fst::SymbolTable const *__pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 1020, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1033
 *     """
 *     cdef stringstream _sstrm
 *     cdef const_SymbolTable_ptr ptr = self._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1033, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1033, __pyx_L1_error)
  __pyx_v_ptr = __pyx_t_6;

  /* "pywrapfst.pyx":1035
 *     cdef const_SymbolTable_ptr ptr = self._raw_ptr_or_raise()
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ptr.Write(_sstrm)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1036
 *     cdef bool _result
 *     with nogil:
 *       _result = ptr.Write(_sstrm)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIOError("Write to string failed")
*/
        __pyx_v__result = __pyx_v_ptr->Write(__pyx_v__sstrm);
      }

      /* "pywrapfst.pyx":1035
 *     cdef const_SymbolTable_ptr ptr = self._raw_ptr_or_raise()
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ptr.Write(_sstrm)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1037
 *     with nogil:
 *       _result = ptr.Write(_sstrm)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()
*/
  __pyx_t_7 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":1038
 *       _result = ptr.Write(_sstrm)
 *     if not _result:
 *       raise FstIOError("Write to string failed")             # <<<<<<<<<<<<<<
 *     return _sstrm.str()
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Write_to_string_failed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1038, __pyx_L1_error)

    /* "pywrapfst.pyx":1037
 *     with nogil:
 *       _result = ptr.Write(_sstrm)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()
*/
  }

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_15SymbolTableView_28write_to_string, "\n    write_to_string(self)\n\n    Serializes SymbolTable to a string.\n\n    Returns:\n      A bytestring.\n\n    Raises:\n      FstIOError: Write to string failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_15SymbolTableView_29write_to_string = {"write_to_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_28write_to_string};
static PyObject *__pyx_pw_9pywrapfst_15SymbolTableView_29write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("write_to_string", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("write_to_string", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_15SymbolTableView_28write_to_string(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_15SymbolTableView_28write_to_string(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_15SymbolTableView_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __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.SymbolTableView.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":1057
 *   # Doing so will allow undefined behavior.
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_28_EncodeMapperSymbolTableView_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_28_EncodeMapperSymbolTableView_1__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_28_EncodeMapperSymbolTableView___repr__(((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_28_EncodeMapperSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1058
 * 
 *   def __repr__(self):
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "             # <<<<<<<<<<<<<<
 *             f"at 0x{id(self):x}>")
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
    __PYX_ERR(0, 1058, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1058, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1059
 *   def __repr__(self):
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")             # <<<<<<<<<<<<<<
 * 
 *   cdef const_SymbolTable_ptr _raw(self):
*/
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_const_EncodeMapper_SymbolTableV;
  __pyx_t_5[1] = __pyx_t_3;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_5[3] = __pyx_t_4;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__3;

  /* "pywrapfst.pyx":1058
 * 
 *   def __repr__(self):
 *     return (f"<const EncodeMapper SymbolTableView {self.name()!r} "             # <<<<<<<<<<<<<<
 *             f"at 0x{id(self):x}>")
 * 
*/
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, 36 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1058, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

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

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

static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_28_EncodeMapperSymbolTableView__raw(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v_self) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

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

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

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_FstSymbolTableView_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19_FstSymbolTableView_1__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_19_FstSymbolTableView___repr__(((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_FstSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1081
 * 
 *   def __repr__(self):
 *     return (f"<const Fst SymbolTableView {self.name()!r} "             # <<<<<<<<<<<<<<
 *             f"at 0x{id(self):x}>")
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
    __PYX_ERR(0, 1081, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1081, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1082
 *   def __repr__(self):
 *     return (f"<const Fst SymbolTableView {self.name()!r} "
 *             f"at 0x{id(self):x}>")             # <<<<<<<<<<<<<<
 * 
 *   cdef const_SymbolTable_ptr _raw(self):
*/
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_const_Fst_SymbolTableView;
  __pyx_t_5[1] = __pyx_t_3;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_5[3] = __pyx_t_4;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__3;

  /* "pywrapfst.pyx":1081
 * 
 *   def __repr__(self):
 *     return (f"<const Fst SymbolTableView {self.name()!r} "             # <<<<<<<<<<<<<<
 *             f"at 0x{id(self):x}>")
 * 
*/
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, 27 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

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

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

static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_19_FstSymbolTableView__raw(struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v_self) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

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

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

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

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

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

static __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__raw(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_r;
  fst::SymbolTable *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

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

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

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

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

static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw(CYTHON_UNUSED struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self) {
  __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_r;

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

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

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

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

static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw_ptr_or_raise(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self) {
  __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_v_mutable_raw;
  __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_r;
  fst::SymbolTable *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

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

  /* "pywrapfst.pyx":1114
 *   cdef SymbolTable_ptr _mutable_raw_ptr_or_raise(self) except *:
 *     cdef SymbolTable_ptr mutable_raw = self._mutable_raw()
 *     if mutable_raw == NULL:             # <<<<<<<<<<<<<<
 *       self._raise_nonexistent()
 *     return mutable_raw
*/
  __pyx_t_2 = (__pyx_v_mutable_raw == NULL);
  if (__pyx_t_2) {

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

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

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

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

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

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

static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int64_t __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) {
  int64_t __pyx_v_key = __pyx_mstate_global->__pyx_k__5;
  __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_v__mutable_raw;
  std::string __pyx_v__symbol;
  int64_t __pyx_v__index;
  int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int64_t __pyx_t_7;
  fst::SymbolTable *__pyx_t_8;
  std::string __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_symbol", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_key = __pyx_optional_args->key;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1118, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1118, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_symbol, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_7 = __Pyx_PyLong_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_7 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1118, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

  /* "pywrapfst.pyx":1136
 *     """
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _symbol = tostring(symbol)             # <<<<<<<<<<<<<<
 *     cdef int64_t _index
 *     if key != fst.kNoSymbol:
*/
  __pyx_t_9 = __pyx_f_9pywrapfst_tostring(__pyx_v_symbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1136, __pyx_L1_error)
  __pyx_v__symbol = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

  /* "pywrapfst.pyx":1138
 *     cdef string _symbol = tostring(symbol)
 *     cdef int64_t _index
 *     if key != fst.kNoSymbol:             # <<<<<<<<<<<<<<
 *       with nogil:
 *         _index = _mutable_raw.AddSymbol(_symbol, key)
*/
  __pyx_t_10 = (__pyx_v_key != fst::kNoSymbol);
  if (__pyx_t_10) {

    /* "pywrapfst.pyx":1139
 *     cdef int64_t _index
 *     if key != fst.kNoSymbol:
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _index = _mutable_raw.AddSymbol(_symbol, key)
 *     else:
*/
    {
        PyThreadState *_save;
        _save = NULL;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pywrapfst.pyx":1140
 *     if key != fst.kNoSymbol:
 *       with nogil:
 *         _index = _mutable_raw.AddSymbol(_symbol, key)             # <<<<<<<<<<<<<<
 *     else:
 *       with nogil:
*/
          __pyx_v__index = __pyx_v__mutable_raw->AddSymbol(__pyx_v__symbol, __pyx_v_key);
        }

        /* "pywrapfst.pyx":1139
 *     cdef int64_t _index
 *     if key != fst.kNoSymbol:
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _index = _mutable_raw.AddSymbol(_symbol, key)
 *     else:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L6;
          }
          __pyx_L6:;
        }
    }

    /* "pywrapfst.pyx":1138
 *     cdef string _symbol = tostring(symbol)
 *     cdef int64_t _index
 *     if key != fst.kNoSymbol:             # <<<<<<<<<<<<<<
 *       with nogil:
 *         _index = _mutable_raw.AddSymbol(_symbol, key)
*/
    goto __pyx_L3;
  }

  /* "pywrapfst.pyx":1142
 *         _index = _mutable_raw.AddSymbol(_symbol, key)
 *     else:
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _index = _mutable_raw.AddSymbol(_symbol)
 *     return _index
*/
  /*else*/ {
    {
        PyThreadState *_save;
        _save = NULL;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pywrapfst.pyx":1143
 *     else:
 *       with nogil:
 *         _index = _mutable_raw.AddSymbol(_symbol)             # <<<<<<<<<<<<<<
 *     return _index
 * 
*/
          __pyx_v__index = __pyx_v__mutable_raw->AddSymbol(__pyx_v__symbol);
        }

        /* "pywrapfst.pyx":1142
 *         _index = _mutable_raw.AddSymbol(_symbol, key)
 *     else:
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _index = _mutable_raw.AddSymbol(_symbol)
 *     return _index
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L9;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pywrapfst.pyx":1144
 *       with nogil:
 *         _index = _mutable_raw.AddSymbol(_symbol)
 *     return _index             # <<<<<<<<<<<<<<
 * 
 *   cpdef void add_table(self, SymbolTableView symbols) except *:
*/
  __pyx_r = __pyx_v__index;
  goto __pyx_L0;

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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 PyMethodDef __pyx_mdef_9pywrapfst_19_MutableSymbolTable_1add_symbol = {"add_symbol", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableSymbolTable_add_symbol};
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_1add_symbol(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_symbol = 0;
  int64_t __pyx_v_key;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_symbol (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symbol,&__pyx_mstate_global->__pyx_n_u_key,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1118, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_symbol", 0) < 0) __PYX_ERR(0, 1118, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_symbol", 0, 1, 2, i); __PYX_ERR(0, 1118, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1118, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1118, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_symbol = values[0];
    if (values[1]) {
      __pyx_v_key = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_key == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L3_error)
    } else {
      __pyx_v_key = __pyx_mstate_global->__pyx_k__5;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_symbol", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 1118, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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, int64_t __pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  struct __pyx_opt_args_9pywrapfst_19_MutableSymbolTable_add_symbol __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_symbol", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.key = __pyx_v_key;
  __pyx_t_1 = __pyx_vtabptr_9pywrapfst__MutableSymbolTable->add_symbol(__pyx_v_self, __pyx_v_symbol, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1118, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1118, __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":1146
 *     return _index
 * 
 *   cpdef void add_table(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_table(self, symbols)
*/

static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(struct __pyx_obj_9pywrapfst__MutableSymbolTable *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols, int __pyx_skip_dispatch) {
  __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_v__sym1;
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v__sym2;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  fst::SymbolTable *__pyx_t_6;
  fst::SymbolTable const *__pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_table", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_symbols)};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1158
 *       symbols: A SymbolTable to be merged with the current table.
 *     """
 *     cdef SymbolTable_ptr _sym1 = self._mutable_raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const_SymbolTable_ptr _sym2 = symbols._raw_ptr_or_raise()
 *     with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw_ptr_or_raise");
    __PYX_ERR(0, 1158, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1158, __pyx_L1_error)
  __pyx_v__sym1 = __pyx_t_6;

  /* "pywrapfst.pyx":1159
 *     """
 *     cdef SymbolTable_ptr _sym1 = self._mutable_raw_ptr_or_raise()
 *     cdef const_SymbolTable_ptr _sym2 = symbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     with nogil:
 *       _sym1.AddTable(deref(_sym2))
*/
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1159, __pyx_L1_error)
  }
  __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error)
  __pyx_v__sym2 = __pyx_t_7;

  /* "pywrapfst.pyx":1160
 *     cdef SymbolTable_ptr _sym1 = self._mutable_raw_ptr_or_raise()
 *     cdef const_SymbolTable_ptr _sym2 = symbols._raw_ptr_or_raise()
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _sym1.AddTable(deref(_sym2))
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1161
 *     cdef const_SymbolTable_ptr _sym2 = symbols._raw_ptr_or_raise()
 *     with nogil:
 *       _sym1.AddTable(deref(_sym2))             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_name(self, new_name) except *:
*/
        __pyx_v__sym1->AddTable((*__pyx_v__sym2));
      }

      /* "pywrapfst.pyx":1160
 *     cdef SymbolTable_ptr _sym1 = self._mutable_raw_ptr_or_raise()
 *     cdef const_SymbolTable_ptr _sym2 = symbols._raw_ptr_or_raise()
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _sym1.AddTable(deref(_sym2))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1146
 *     return _index
 * 
 *   cpdef void add_table(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_table(self, symbols)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableSymbolTable_2add_table, "\n    add_table(self, symbols)\n\n    Adds another SymbolTable to this table.\n\n    This method merges another symbol table into the current table. All key\n    values will be offset by the current available key.\n\n    Args:\n      symbols: A SymbolTable to be merged with the current table.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableSymbolTable_3add_table = {"add_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableSymbolTable_2add_table};
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_3add_table(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symbols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1146, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1146, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_table", 0) < 0) __PYX_ERR(0, 1146, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_table", 1, 1, 1, i); __PYX_ERR(0, 1146, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1146, __pyx_L3_error)
    }
    __pyx_v_symbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_table", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1146, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._MutableSymbolTable.add_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1146, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableSymbolTable_2add_table(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), __pyx_v_symbols);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_19_MutableSymbolTable_add_table(__pyx_v_self, __pyx_v_symbols, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1146, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __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":1163
 *       _sym1.AddTable(deref(_sym2))
 * 
 *   cpdef void set_name(self, new_name) except *:             # <<<<<<<<<<<<<<
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _new_name = tostring(new_name)
*/

static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
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_t_9pywrapfst_SymbolTable_ptr __pyx_v__mutable_raw;
  std::string __pyx_v__new_name;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  fst::SymbolTable *__pyx_t_6;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_name", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_set_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_new_name};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1164
 * 
 *   cpdef void set_name(self, new_name) except *:
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef string _new_name = tostring(new_name)
 *     with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mutable_raw_ptr_or_raise");
    __PYX_ERR(0, 1164, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__MutableSymbolTable *)__pyx_v_self->__pyx_base.__pyx_vtab)->_mutable_raw_ptr_or_raise(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1164, __pyx_L1_error)
  __pyx_v__mutable_raw = __pyx_t_6;

  /* "pywrapfst.pyx":1165
 *   cpdef void set_name(self, new_name) except *:
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _new_name = tostring(new_name)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       _mutable_raw.SetName(_new_name)
*/
  __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_new_name); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1165, __pyx_L1_error)
  __pyx_v__new_name = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pywrapfst.pyx":1166
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _new_name = tostring(new_name)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _mutable_raw.SetName(_new_name)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1167
 *     cdef string _new_name = tostring(new_name)
 *     with nogil:
 *       _mutable_raw.SetName(_new_name)             # <<<<<<<<<<<<<<
 * 
 * 
*/
        __pyx_v__mutable_raw->SetName(__pyx_v__new_name);
      }

      /* "pywrapfst.pyx":1166
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _new_name = tostring(new_name)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _mutable_raw.SetName(_new_name)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1163
 *       _sym1.AddTable(deref(_sym2))
 * 
 *   cpdef void set_name(self, new_name) except *:             # <<<<<<<<<<<<<<
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _new_name = tostring(new_name)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableSymbolTable_5set_name = {"set_name", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_19_MutableSymbolTable_5set_name(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_new_name = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_name (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_new_name,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1163, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1163, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_name", 0) < 0) __PYX_ERR(0, 1163, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_name", 1, 1, 1, i); __PYX_ERR(0, 1163, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1163, __pyx_L3_error)
    }
    __pyx_v_new_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_name", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1163, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._MutableSymbolTable.set_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableSymbolTable_4set_name(((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)__pyx_v_self), __pyx_v_new_name);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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, 1163, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_26_MutableFstSymbolTableView_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_26_MutableFstSymbolTableView_1__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_26_MutableFstSymbolTableView___repr__(((struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_26_MutableFstSymbolTableView___repr__(struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1178
 * 
 *   def __repr__(self):
 *     return f"<Fst SymbolTableView {self.name()!r} at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
    __PYX_ERR(0, 1178, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1178, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_Fst_SymbolTableView;
  __pyx_t_5[1] = __pyx_t_3;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_5[3] = __pyx_t_4;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  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_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

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

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

static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_26_MutableFstSymbolTableView__mutable_raw(struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v_self) {
  __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_r;
  fst::SymbolTable *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":1181
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):
 *     return (self._mfst.get().MutableInputSymbols() if self._input_side else             # <<<<<<<<<<<<<<
 *             self._mfst.get().MutableOutputSymbols())
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 1181, __pyx_L1_error)
  }
  __pyx_t_2 = (__pyx_v_self->_input_side != 0);
  if (__pyx_t_2) {
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 1181, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mfst.get()->MutableInputSymbols();
  } else {

    /* "pywrapfst.pyx":1182
 *   cdef SymbolTable_ptr _mutable_raw(self):
 *     return (self._mfst.get().MutableInputSymbols() if self._input_side else
 *             self._mfst.get().MutableOutputSymbols())             # <<<<<<<<<<<<<<
 * 
 * 
*/
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 1182, __pyx_L1_error)
    }
    __pyx_t_1 = __pyx_v_self->_mfst.get()->MutableOutputSymbols();
  }
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._MutableFstSymbolTableView._mutable_raw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

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

/* 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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1203
 * 
 *   def __repr__(self):
 *     return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, name="<unspecified>"):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "name");
    __PYX_ERR(0, 1203, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.name(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u_SymbolTable;
  __pyx_t_5[1] = __pyx_t_3;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_at_0x;
  __pyx_t_5[3] = __pyx_t_4;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_2 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, 13 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 6 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":1205
 *     return f"<SymbolTable {self.name()!r} at 0x{id(self):x}>"
 * 
 *   def __init__(self, name="<unspecified>"):             # <<<<<<<<<<<<<<
 *     self._smart_table.reset(new fst.SymbolTable(tostring(name)))
 * 
*/

/* Python wrapper */
static int __pyx_pw_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;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_name_2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1205, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1205, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u_unspecified));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1205, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u_unspecified));
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 1205, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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;
  std::string __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

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

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

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

/* "pywrapfst.pyx":1208
 *     self._smart_table.reset(new fst.SymbolTable(tostring(name)))
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):             # <<<<<<<<<<<<<<
 *     return self._smart_table.get()
 * 
*/

static __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_f_9pywrapfst_11SymbolTable__mutable_raw(struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v_self) {
  __pyx_t_9pywrapfst_SymbolTable_ptr __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":1209
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):
 *     return self._smart_table.get()             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
    __PYX_ERR(0, 1209, __pyx_L1_error)
  }
  __pyx_r = __pyx_v_self->_smart_table.get();
  goto __pyx_L0;

  /* "pywrapfst.pyx":1208
 *     self._smart_table.reset(new fst.SymbolTable(tostring(name)))
 * 
 *   cdef SymbolTable_ptr _mutable_raw(self):             # <<<<<<<<<<<<<<
 *     return self._smart_table.get()
 * 
*/

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

/* "pywrapfst.pyx":1211
 *     return self._smart_table.get()
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_5read(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_11SymbolTable_4read, "\n    SymbolTable.read(source)\n\n    Reads symbol table from binary file.\n\n    This class method creates a new SymbolTable from a symbol table binary file.\n\n    Args:\n      source: The string location of the input binary file.\n\n    Returns:\n      A new SymbolTable instance.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_11SymbolTable_5read = {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_11SymbolTable_5read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_11SymbolTable_4read};
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_5read(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1211, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1211, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read", 0) < 0) __PYX_ERR(0, 1211, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, i); __PYX_ERR(0, 1211, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1211, __pyx_L3_error)
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1211, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.SymbolTable.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_11SymbolTable_4read(((PyTypeObject*)__pyx_v_cls), __pyx_v_source);

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_4read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  std::unique_ptr<fst::SymbolTable>  __pyx_v__symbols;
  std::string __pyx_v__source;
  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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pywrapfst.pyx":1227
 *     """
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       _symbols.reset(fst.SymbolTable.Read(_source))
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1227, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":1228
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     cdef string _source = path_tostring(source)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _symbols.reset(fst.SymbolTable.Read(_source))
 *     if _symbols.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1229
 *     cdef string _source = path_tostring(source)
 *     with nogil:
 *       _symbols.reset(fst.SymbolTable.Read(_source))             # <<<<<<<<<<<<<<
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
*/
        __pyx_v__symbols.reset(fst::SymbolTable::Read(__pyx_v__source));
      }

      /* "pywrapfst.pyx":1228
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     cdef string _source = path_tostring(source)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _symbols.reset(fst.SymbolTable.Read(_source))
 *     if _symbols.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1230
 *     with nogil:
 *       _symbols.reset(fst.SymbolTable.Read(_source))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
*/
  __pyx_t_2 = (__pyx_v__symbols.get() == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":1231
 *       _symbols.reset(fst.SymbolTable.Read(_source))
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(move(_symbols))
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Read_failed, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1231, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1231, __pyx_L1_error)

    /* "pywrapfst.pyx":1230
 *     with nogil:
 *       _symbols.reset(fst.SymbolTable.Read(_source))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
*/
  }

  /* "pywrapfst.pyx":1232
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(cython_std::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1211
 *     return self._smart_table.get()
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":1234
 *     return _init_SymbolTable(move(_symbols))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_text(cls, source, *, sep="\t "):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_7read_text(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_11SymbolTable_6read_text, "\n    SymbolTable.read_text(source, *, sep=\"\t \")\n\n    Reads symbol table from text file.\n\n    This class method creates a new SymbolTable from a symbol table text file.\n\n    Args:\n      source: The string location of the input text file.\n      sep: Characters to be used as a separator between fields in a textual\n          SymbolTable file, encoded as a string. Only the first byte is used.\n\n    Returns:\n      A new SymbolTable instance.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_11SymbolTable_7read_text = {"read_text", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_11SymbolTable_7read_text, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_11SymbolTable_6read_text};
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_7read_text(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_sep = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_text (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,&__pyx_mstate_global->__pyx_n_u_sep,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1234, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1234, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read_text", 0) < 0) __PYX_ERR(0, 1234, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__4));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_text", 1, 1, 1, i); __PYX_ERR(0, 1234, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1234, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__4));
    }
    __pyx_v_source = values[0];
    __pyx_v_sep = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_text", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1234, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_source, __pyx_v_sep);

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_6read_text(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, PyObject *__pyx_v_sep) {
  std::unique_ptr<fst::SymbolTable>  __pyx_v__symbols;
  std::string __pyx_v__source;
  std::string __pyx_v__sep;
  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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_text", 0);

  /* "pywrapfst.pyx":1252
 *     """
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     cdef string _sep = tostring(sep)
 *     with nogil:
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1252, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":1253
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     cdef string _source = path_tostring(source)
 *     cdef string _sep = tostring(sep)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       _symbols.reset(fst.SymbolTable.ReadText(_source, _sep))
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sep); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1253, __pyx_L1_error)
  __pyx_v__sep = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":1254
 *     cdef string _source = path_tostring(source)
 *     cdef string _sep = tostring(sep)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _symbols.reset(fst.SymbolTable.ReadText(_source, _sep))
 *     if _symbols.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1255
 *     cdef string _sep = tostring(sep)
 *     with nogil:
 *       _symbols.reset(fst.SymbolTable.ReadText(_source, _sep))             # <<<<<<<<<<<<<<
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
*/
        __pyx_v__symbols.reset(fst::SymbolTable::ReadText(__pyx_v__source, __pyx_v__sep));
      }

      /* "pywrapfst.pyx":1254
 *     cdef string _source = path_tostring(source)
 *     cdef string _sep = tostring(sep)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _symbols.reset(fst.SymbolTable.ReadText(_source, _sep))
 *     if _symbols.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1256
 *     with nogil:
 *       _symbols.reset(fst.SymbolTable.ReadText(_source, _sep))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
*/
  __pyx_t_2 = (__pyx_v__symbols.get() == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":1257
 *       _symbols.reset(fst.SymbolTable.ReadText(_source, _sep))
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(move(_symbols))
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Read_failed, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1257, __pyx_L1_error)

    /* "pywrapfst.pyx":1256
 *     with nogil:
 *       _symbols.reset(fst.SymbolTable.ReadText(_source, _sep))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
*/
  }

  /* "pywrapfst.pyx":1258
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(cython_std::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1234
 *     return _init_SymbolTable(move(_symbols))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_text(cls, source, *, sep="\t "):
 *     """
*/

  /* 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_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":1260
 *     return _init_SymbolTable(move(_symbols))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_fst(cls, source, bool input_table):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_9read_fst(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_11SymbolTable_8read_fst, "\n    SymbolTable.read_fst(source, input_table)\n\n    Reads symbol table from an FST file without loading the corresponding FST.\n\n    This class method creates a new SymbolTable by reading either the input or\n    output symbol table from an FST file, without loading the corresponding FST.\n\n    Args:\n      source: The string location of the input FST file.\n      input_table: Should the input table be read (True) or the output table\n          (False)?\n\n    Returns:\n      A new SymbolTable instance, or None if none can be read.\n\n    Raises:\n      FstIOError: Read failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_11SymbolTable_9read_fst = {"read_fst", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_11SymbolTable_9read_fst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_11SymbolTable_8read_fst};
static PyObject *__pyx_pw_9pywrapfst_11SymbolTable_9read_fst(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  bool __pyx_v_input_table;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_fst (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,&__pyx_mstate_global->__pyx_n_u_input_table,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1260, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read_fst", 0) < 0) __PYX_ERR(0, 1260, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, i); __PYX_ERR(0, 1260, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1260, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1260, __pyx_L3_error)
    }
    __pyx_v_source = values[0];
    __pyx_v_input_table = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_input_table == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1261, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_fst", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_source, __pyx_v_input_table);

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

static PyObject *__pyx_pf_9pywrapfst_11SymbolTable_8read_fst(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, bool __pyx_v_input_table) {
  std::unique_ptr<fst::SymbolTable>  __pyx_v__symbols;
  std::string __pyx_v__source;
  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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_fst", 0);

  /* "pywrapfst.pyx":1282
 *     """
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       _symbols.reset(fst.FstReadSymbols(_source, input_table))
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1282, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":1283
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     cdef string _source = path_tostring(source)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _symbols.reset(fst.FstReadSymbols(_source, input_table))
 *     if _symbols.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1284
 *     cdef string _source = path_tostring(source)
 *     with nogil:
 *       _symbols.reset(fst.FstReadSymbols(_source, input_table))             # <<<<<<<<<<<<<<
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read from FST failed: {source!r}")
*/
        __pyx_v__symbols.reset(fst::FstReadSymbols(__pyx_v__source, __pyx_v_input_table));
      }

      /* "pywrapfst.pyx":1283
 *     cdef unique_ptr[fst.SymbolTable] _symbols
 *     cdef string _source = path_tostring(source)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _symbols.reset(fst.FstReadSymbols(_source, input_table))
 *     if _symbols.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1285
 *     with nogil:
 *       _symbols.reset(fst.FstReadSymbols(_source, input_table))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read from FST failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
*/
  __pyx_t_2 = (__pyx_v__symbols.get() == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":1286
 *       _symbols.reset(fst.FstReadSymbols(_source, input_table))
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read from FST failed: {source!r}")             # <<<<<<<<<<<<<<
 *     return _init_SymbolTable(move(_symbols))
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Read_from_FST_failed, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1286, __pyx_L1_error)

    /* "pywrapfst.pyx":1285
 *     with nogil:
 *       _symbols.reset(fst.FstReadSymbols(_source, input_table))
 *     if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read from FST failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))
*/
  }

  /* "pywrapfst.pyx":1287
 *     if _symbols.get() == NULL:
 *       raise FstIOError(f"Read from FST failed: {source!r}")
 *     return _init_SymbolTable(move(_symbols))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(cython_std::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1260
 *     return _init_SymbolTable(move(_symbols))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_fst(cls, source, bool 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_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;
}

/* "pywrapfst.pyx":1290
 * 
 * 
 * cdef _EncodeMapperSymbolTableView _init_EncodeMapperSymbolTableView(             # <<<<<<<<<<<<<<
 *     shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
 *   cdef _EncodeMapperSymbolTableView _symbols = (
*/

static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(std::shared_ptr<fst::script::EncodeMapperClass>  __pyx_v_mapper, bool __pyx_v_input_side) {
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_v__symbols = 0;
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_EncodeMapperSymbolTableView", 0);

  /* "pywrapfst.pyx":1293
 *     shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
 *   cdef _EncodeMapperSymbolTableView _symbols = (
 *       _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))             # <<<<<<<<<<<<<<
 *   _symbols._mapper = move(mapper)
 *   _symbols._input_side = input_side
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1294
 *   cdef _EncodeMapperSymbolTableView _symbols = (
 *       _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))
 *   _symbols._mapper = move(mapper)             # <<<<<<<<<<<<<<
 *   _symbols._input_side = input_side
 *   return _symbols
*/
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1294, __pyx_L1_error)
  }
  __pyx_v__symbols->_mapper = cython_std::move<std::shared_ptr<fst::script::EncodeMapperClass> >(__pyx_v_mapper);

  /* "pywrapfst.pyx":1295
 *       _EncodeMapperSymbolTableView.__new__(_EncodeMapperSymbolTableView))
 *   _symbols._mapper = move(mapper)
 *   _symbols._input_side = input_side             # <<<<<<<<<<<<<<
 *   return _symbols
 * 
*/
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 1295, __pyx_L1_error)
  }
  __pyx_v__symbols->_input_side = __pyx_v_input_side;

  /* "pywrapfst.pyx":1296
 *   _symbols._mapper = move(mapper)
 *   _symbols._input_side = input_side
 *   return _symbols             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v__symbols);
  __pyx_r = __pyx_v__symbols;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1290
 * 
 * 
 * cdef _EncodeMapperSymbolTableView _init_EncodeMapperSymbolTableView(             # <<<<<<<<<<<<<<
 *     shared_ptr[fst.EncodeMapperClass] mapper, bool input_side):
 *   cdef _EncodeMapperSymbolTableView _symbols = (
*/

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

/* "pywrapfst.pyx":1299
 * 
 * 
 * cdef _FstSymbolTableView _init_FstSymbolTableView(shared_ptr[fst.FstClass] ifst,             # <<<<<<<<<<<<<<
 *                                                   bool input_side):
 *   cdef _FstSymbolTableView _symbols = (
*/

static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst__init_FstSymbolTableView(std::shared_ptr<fst::script::FstClass>  __pyx_v_ifst, bool __pyx_v_input_side) {
  struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_v__symbols = 0;
  struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_FstSymbolTableView", 0);

  /* "pywrapfst.pyx":1302
 *                                                   bool input_side):
 *   cdef _FstSymbolTableView _symbols = (
 *       _FstSymbolTableView.__new__(_FstSymbolTableView))             # <<<<<<<<<<<<<<
 *   _symbols._fst = move(ifst)
 *   _symbols._input_side = input_side
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__FstSymbolTableView(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__FstSymbolTableView), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1303
 *   cdef _FstSymbolTableView _symbols = (
 *       _FstSymbolTableView.__new__(_FstSymbolTableView))
 *   _symbols._fst = move(ifst)             # <<<<<<<<<<<<<<
 *   _symbols._input_side = input_side
 *   return _symbols
*/
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1303, __pyx_L1_error)
  }
  __pyx_v__symbols->_fst = cython_std::move<std::shared_ptr<fst::script::FstClass> >(__pyx_v_ifst);

  /* "pywrapfst.pyx":1304
 *       _FstSymbolTableView.__new__(_FstSymbolTableView))
 *   _symbols._fst = move(ifst)
 *   _symbols._input_side = input_side             # <<<<<<<<<<<<<<
 *   return _symbols
 * 
*/
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 1304, __pyx_L1_error)
  }
  __pyx_v__symbols->_input_side = __pyx_v_input_side;

  /* "pywrapfst.pyx":1305
 *   _symbols._fst = move(ifst)
 *   _symbols._input_side = input_side
 *   return _symbols             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v__symbols);
  __pyx_r = __pyx_v__symbols;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1299
 * 
 * 
 * cdef _FstSymbolTableView _init_FstSymbolTableView(shared_ptr[fst.FstClass] ifst,             # <<<<<<<<<<<<<<
 *                                                   bool input_side):
 *   cdef _FstSymbolTableView _symbols = (
*/

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

/* "pywrapfst.pyx":1308
 * 
 * 
 * cdef _MutableFstSymbolTableView _init_MutableFstSymbolTableView(             # <<<<<<<<<<<<<<
 *                                     shared_ptr[fst.MutableFstClass] ifst,
 *                                     bool input_side):
*/

static struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(std::shared_ptr<fst::script::MutableFstClass>  __pyx_v_ifst, bool __pyx_v_input_side) {
  struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_v__symbols = 0;
  struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_MutableFstSymbolTableView", 0);

  /* "pywrapfst.pyx":1312
 *                                     bool input_side):
 *   cdef _MutableFstSymbolTableView _symbols = (
 *       _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))             # <<<<<<<<<<<<<<
 *   _symbols._mfst = move(ifst)
 *   _symbols._input_side = input_side
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst__MutableFstSymbolTableView(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1312, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__symbols = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1313
 *   cdef _MutableFstSymbolTableView _symbols = (
 *       _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))
 *   _symbols._mfst = move(ifst)             # <<<<<<<<<<<<<<
 *   _symbols._input_side = input_side
 *   return _symbols
*/
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 1313, __pyx_L1_error)
  }
  __pyx_v__symbols->_mfst = cython_std::move<std::shared_ptr<fst::script::MutableFstClass> >(__pyx_v_ifst);

  /* "pywrapfst.pyx":1314
 *       _MutableFstSymbolTableView.__new__(_MutableFstSymbolTableView))
 *   _symbols._mfst = move(ifst)
 *   _symbols._input_side = input_side             # <<<<<<<<<<<<<<
 *   return _symbols
 * 
*/
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_input_side");
    __PYX_ERR(0, 1314, __pyx_L1_error)
  }
  __pyx_v__symbols->_input_side = __pyx_v_input_side;

  /* "pywrapfst.pyx":1315
 *   _symbols._mfst = move(ifst)
 *   _symbols._input_side = input_side
 *   return _symbols             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v__symbols);
  __pyx_r = __pyx_v__symbols;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1308
 * 
 * 
 * cdef _MutableFstSymbolTableView _init_MutableFstSymbolTableView(             # <<<<<<<<<<<<<<
 *                                     shared_ptr[fst.MutableFstClass] ifst,
 *                                     bool input_side):
*/

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

/* "pywrapfst.pyx":1318
 * 
 * 
 * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):             # <<<<<<<<<<<<<<
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
 *   _symbols._smart_table = move(symbols)
*/

static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__init_SymbolTable(std::unique_ptr<fst::SymbolTable>  __pyx_v_symbols) {
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_v__symbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_SymbolTable", 0);

  /* "pywrapfst.pyx":1319
 * 
 * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)             # <<<<<<<<<<<<<<
 *   _symbols._smart_table = move(symbols)
 *   return _symbols
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_SymbolTable(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__symbols = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1320
 * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
 *   _symbols._smart_table = move(symbols)             # <<<<<<<<<<<<<<
 *   return _symbols
 * 
*/
  if (unlikely(((PyObject *)__pyx_v__symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_smart_table");
    __PYX_ERR(0, 1320, __pyx_L1_error)
  }
  __pyx_v__symbols->_smart_table = cython_std::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v_symbols);

  /* "pywrapfst.pyx":1321
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
 *   _symbols._smart_table = move(symbols)
 *   return _symbols             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v__symbols);
  __pyx_r = __pyx_v__symbols;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1318
 * 
 * 
 * cdef SymbolTable _init_SymbolTable(unique_ptr[fst.SymbolTable] symbols):             # <<<<<<<<<<<<<<
 *   cdef SymbolTable _symbols = SymbolTable.__new__(SymbolTable)
 *   _symbols._smart_table = move(symbols)
*/

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

/* "pywrapfst.pyx":1324
 * 
 * 
 * cpdef SymbolTable _read_SymbolTable_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/

static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst__read_SymbolTable_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  std::unique_ptr<fst::SymbolTable>  __pyx_v__symbols;
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_SymbolTable_from_string", 0);

  /* "pywrapfst.pyx":1326
 * cpdef SymbolTable _read_SymbolTable_from_string(string state):
 *   cdef stringstream _sstrm
 *   _sstrm << state             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.SymbolTable] _symbols
 *   with nogil:
*/
  (void)((__pyx_v__sstrm << __pyx_v_state));

  /* "pywrapfst.pyx":1328
 *   _sstrm << state
 *   cdef unique_ptr[fst.SymbolTable] _symbols
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _symbols.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1329
 *   cdef unique_ptr[fst.SymbolTable] _symbols
 *   with nogil:
 *     _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))             # <<<<<<<<<<<<<<
 *   if _symbols.get() == NULL:
 *     raise FstIOError("Read from string failed")
*/
        __pyx_v__symbols.reset(fst::SymbolTable::Read(__pyx_v__sstrm, __pyx_k_pywrapfst));
      }

      /* "pywrapfst.pyx":1328
 *   _sstrm << state
 *   cdef unique_ptr[fst.SymbolTable] _symbols
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _symbols.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1330
 *   with nogil:
 *     _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_SymbolTable(move(_symbols))
*/
  __pyx_t_1 = (__pyx_v__symbols.get() == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":1331
 *     _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _symbols.get() == NULL:
 *     raise FstIOError("Read from string failed")             # <<<<<<<<<<<<<<
 *   return _init_SymbolTable(move(_symbols))
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1331, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Read_from_string_failed};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1331, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1331, __pyx_L1_error)

    /* "pywrapfst.pyx":1330
 *   with nogil:
 *     _symbols.reset(fst.SymbolTable.ReadStream(_sstrm, b"<pywrapfst>"))
 *   if _symbols.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_SymbolTable(move(_symbols))
*/
  }

  /* "pywrapfst.pyx":1332
 *   if _symbols.get() == NULL:
 *     raise FstIOError("Read from string failed")
 *   return _init_SymbolTable(move(_symbols))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(cython_std::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__symbols))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1324
 * 
 * 
 * cpdef SymbolTable _read_SymbolTable_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst._read_SymbolTable_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_9_read_SymbolTable_from_string = {"_read_SymbolTable_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_9_read_SymbolTable_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  std::string __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_SymbolTable_from_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1324, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1324, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_read_SymbolTable_from_string", 0) < 0) __PYX_ERR(0, 1324, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_read_SymbolTable_from_string", 1, 1, 1, i); __PYX_ERR(0, 1324, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1324, __pyx_L3_error)
    }
    __pyx_v_state = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1324, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_read_SymbolTable_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1324, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._read_SymbolTable_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(__pyx_self, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_8_read_SymbolTable_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_SymbolTable_from_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_SymbolTable_from_string(__pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __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_SymbolTable_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1338
 * 
 * 
 * cpdef SymbolTable compact_symbol_table(SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *   """
 *   compact_symbol_table(symbols)
*/

static PyObject *__pyx_pw_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_compact_symbol_table(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_ptr;
  std::unique_ptr<fst::SymbolTable>  __pyx_v__result;
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compact_symbol_table", 0);

  /* "pywrapfst.pyx":1350
 *     A new compacted SymbolTable.
 *   """
 *   cdef const_SymbolTable_ptr ptr = symbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.SymbolTable] _result
 *   with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1350, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1350, __pyx_L1_error)
  __pyx_v_ptr = __pyx_t_1;

  /* "pywrapfst.pyx":1352
 *   cdef const_SymbolTable_ptr ptr = symbols._raw_ptr_or_raise()
 *   cdef unique_ptr[fst.SymbolTable] _result
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _result.reset(fst.CompactSymbolTable(deref(ptr)))
 *   return _init_SymbolTable(move(_result))
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1353
 *   cdef unique_ptr[fst.SymbolTable] _result
 *   with nogil:
 *     _result.reset(fst.CompactSymbolTable(deref(ptr)))             # <<<<<<<<<<<<<<
 *   return _init_SymbolTable(move(_result))
 * 
*/
        __pyx_v__result.reset(fst::CompactSymbolTable((*__pyx_v_ptr)));
      }

      /* "pywrapfst.pyx":1352
 *   cdef const_SymbolTable_ptr ptr = symbols._raw_ptr_or_raise()
 *   cdef unique_ptr[fst.SymbolTable] _result
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _result.reset(fst.CompactSymbolTable(deref(ptr)))
 *   return _init_SymbolTable(move(_result))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1354
 *   with nogil:
 *     _result.reset(fst.CompactSymbolTable(deref(ptr)))
 *   return _init_SymbolTable(move(_result))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(cython_std::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__result))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1338
 * 
 * 
 * cpdef SymbolTable compact_symbol_table(SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *   """
 *   compact_symbol_table(symbols)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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_11compact_symbol_table(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10compact_symbol_table, "\n  compact_symbol_table(symbols)\n\n  Constructively relabels a SymbolTable to make it a contiguous mapping.\n\n  Args:\n    symbols: Input SymbolTable.\n\n  Returns:\n    A new compacted SymbolTable.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_11compact_symbol_table = {"compact_symbol_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_11compact_symbol_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10compact_symbol_table};
static PyObject *__pyx_pw_9pywrapfst_11compact_symbol_table(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compact_symbol_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symbols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1338, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1338, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "compact_symbol_table", 0) < 0) __PYX_ERR(0, 1338, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compact_symbol_table", 1, 1, 1, i); __PYX_ERR(0, 1338, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1338, __pyx_L3_error)
    }
    __pyx_v_symbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compact_symbol_table", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1338, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.compact_symbol_table", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1338, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10compact_symbol_table(__pyx_self, __pyx_v_symbols);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_10compact_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compact_symbol_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compact_symbol_table(__pyx_v_symbols, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __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":1357
 * 
 * 
 * cpdef SymbolTable merge_symbol_table(SymbolTableView lhs,             # <<<<<<<<<<<<<<
 *                                      SymbolTableView rhs):
 *   """
*/

static PyObject *__pyx_pw_9pywrapfst_13merge_symbol_table(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_f_9pywrapfst_merge_symbol_table(struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_rhs, CYTHON_UNUSED int __pyx_skip_dispatch) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_lhs_ptr;
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_rhs_ptr;
  std::unique_ptr<fst::SymbolTable>  __pyx_v__result;
  struct __pyx_obj_9pywrapfst_SymbolTable *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("merge_symbol_table", 0);

  /* "pywrapfst.pyx":1380
 *     A new merged SymbolTable.
 *   """
 *   cdef const_SymbolTable_ptr lhs_ptr = lhs._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *   cdef const_SymbolTable_ptr rhs_ptr = rhs._raw_ptr_or_raise()
 *   cdef unique_ptr[fst.SymbolTable] _result
*/
  if (unlikely(((PyObject *)__pyx_v_lhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1380, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_lhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_lhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L1_error)
  __pyx_v_lhs_ptr = __pyx_t_1;

  /* "pywrapfst.pyx":1381
 *   """
 *   cdef const_SymbolTable_ptr lhs_ptr = lhs._raw_ptr_or_raise()
 *   cdef const_SymbolTable_ptr rhs_ptr = rhs._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.SymbolTable] _result
 *   with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_rhs) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1381, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_rhs->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_rhs); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
  __pyx_v_rhs_ptr = __pyx_t_1;

  /* "pywrapfst.pyx":1383
 *   cdef const_SymbolTable_ptr rhs_ptr = rhs._raw_ptr_or_raise()
 *   cdef unique_ptr[fst.SymbolTable] _result
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _result.reset(fst.MergeSymbolTable(deref(lhs_ptr), deref(rhs_ptr), NULL))
 *   return _init_SymbolTable(move(_result))
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1384
 *   cdef unique_ptr[fst.SymbolTable] _result
 *   with nogil:
 *     _result.reset(fst.MergeSymbolTable(deref(lhs_ptr), deref(rhs_ptr), NULL))             # <<<<<<<<<<<<<<
 *   return _init_SymbolTable(move(_result))
 * 
*/
        __pyx_v__result.reset(fst::MergeSymbolTable((*__pyx_v_lhs_ptr), (*__pyx_v_rhs_ptr), NULL));
      }

      /* "pywrapfst.pyx":1383
 *   cdef const_SymbolTable_ptr rhs_ptr = rhs._raw_ptr_or_raise()
 *   cdef unique_ptr[fst.SymbolTable] _result
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _result.reset(fst.MergeSymbolTable(deref(lhs_ptr), deref(rhs_ptr), NULL))
 *   return _init_SymbolTable(move(_result))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1385
 *   with nogil:
 *     _result.reset(fst.MergeSymbolTable(deref(lhs_ptr), deref(rhs_ptr), NULL))
 *   return _init_SymbolTable(move(_result))             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_SymbolTable(cython_std::move<std::unique_ptr<fst::SymbolTable> >(__pyx_v__result))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_SymbolTable *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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_13merge_symbol_table(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12merge_symbol_table, "\n  merge_symbol_table(lhs, rhs)\n\n  Merges all symbols from the left table into the right.\n\n  This function creates a new SymbolTable which is the merger of the two input\n  symbol Tables. Symbols in the right-hand table that conflict with those in the\n  left-hand table will be assigned values from the left-hand table. Thus the\n  returned table will never modify symbol assignments from the left-hand side,\n  but may do so on the right.\n\n  If the left-hand table is associated with an FST, it may be necessary to\n  relabel it using the output table.\n\n  Args:\n    lhs: Left-hand side SymbolTable.\n    rhs: Left-hand side SymbolTable.\n\n  Returns:\n    A new merged SymbolTable.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_13merge_symbol_table = {"merge_symbol_table", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_13merge_symbol_table, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12merge_symbol_table};
static PyObject *__pyx_pw_9pywrapfst_13merge_symbol_table(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_lhs = 0;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_rhs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("merge_symbol_table (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_lhs,&__pyx_mstate_global->__pyx_n_u_rhs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1357, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1357, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "merge_symbol_table", 0) < 0) __PYX_ERR(0, 1357, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, i); __PYX_ERR(0, 1357, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1357, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1357, __pyx_L3_error)
    }
    __pyx_v_lhs = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
    __pyx_v_rhs = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("merge_symbol_table", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 1357, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "lhs", 0))) __PYX_ERR(0, 1357, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rhs), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "rhs", 0))) __PYX_ERR(0, 1358, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_12merge_symbol_table(__pyx_self, __pyx_v_lhs, __pyx_v_rhs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_12merge_symbol_table(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_lhs, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_rhs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("merge_symbol_table", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_merge_symbol_table(__pyx_v_lhs, __pyx_v_rhs, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __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":1398
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_20_SymbolTableIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_20_SymbolTableIterator_1__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_20_SymbolTableIterator___repr__(((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator___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[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1399
 * 
 *   def __repr__(self):
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, SymbolTableView symbols):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_SymbolTableIterator_at_0x;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 27 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1398
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1401
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     self._table = symbols
 *     self._it.reset(
*/

/* Python wrapper */
static int __pyx_pw_9pywrapfst_20_SymbolTableIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_20_SymbolTableIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symbols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1401, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1401, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 1401, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1401, __pyx_L3_error)
    }
    __pyx_v_symbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1401, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_symbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1401, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)__pyx_v_self), __pyx_v_symbols);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pywrapfst_20_SymbolTableIterator_2__init__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":1402
 * 
 *   def __init__(self, SymbolTableView symbols):
 *     self._table = symbols             # <<<<<<<<<<<<<<
 *     self._it.reset(
 *         new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1402, __pyx_L1_error)
  }
  __Pyx_INCREF((PyObject *)__pyx_v_symbols);
  __Pyx_GIVEREF((PyObject *)__pyx_v_symbols);
  __Pyx_GOTREF((PyObject *)__pyx_v_self->_table);
  __Pyx_DECREF((PyObject *)__pyx_v_self->_table);
  __pyx_v_self->_table = __pyx_v_symbols;

  /* "pywrapfst.pyx":1403
 *   def __init__(self, SymbolTableView symbols):
 *     self._table = symbols
 *     self._it.reset(             # <<<<<<<<<<<<<<
 *         new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
    __PYX_ERR(0, 1403, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1404
 *     self._table = symbols
 *     self._it.reset(
 *         new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))             # <<<<<<<<<<<<<<
 * 
 *   # This just registers this class as a possible iterator.
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1404, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self->_table) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1404, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1404, __pyx_L1_error)

  /* "pywrapfst.pyx":1403
 *   def __init__(self, SymbolTableView symbols):
 *     self._table = symbols
 *     self._it.reset(             # <<<<<<<<<<<<<<
 *         new fst.SymbolTableIterator(self._table._raw_ptr_or_raise().begin()))
 * 
*/
  __pyx_v_self->_it.reset(new fst::SymbolTable::iterator(__pyx_t_1->begin()));

  /* "pywrapfst.pyx":1401
 *     return f"<_SymbolTableIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     self._table = symbols
 *     self._it.reset(
*/

  /* 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":1407
 * 
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):             # <<<<<<<<<<<<<<
 *     return self
 * 
*/

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

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

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

  /* "pywrapfst.pyx":1408
 *   # 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":1407
 * 
 *   # 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":1411
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self._table._raw_ptr_or_raise().end() == deref(self._it):
 *       raise StopIteration
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_20_SymbolTableIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_20_SymbolTableIterator_7__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_20_SymbolTableIterator_6__next__(((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_6__next__(struct __pyx_obj_9pywrapfst__SymbolTableIterator *__pyx_v_self) {
  int64_t __pyx_v__label;
  std::string __pyx_v__symbol;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  fst::SymbolTable const *__pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pywrapfst.pyx":1412
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self._table._raw_ptr_or_raise().end() == deref(self._it):             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64_t _label = self._it.get().Pair().Label()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_table");
    __PYX_ERR(0, 1412, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self->_table) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 1412, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_self->_table->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_self->_table); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1412, __pyx_L1_error)
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
    __PYX_ERR(0, 1412, __pyx_L1_error)
  }
  __pyx_t_2 = ((__pyx_t_1->end() == (*__pyx_v_self->_it)) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":1413
 *   def __next__(self):
 *     if self._table._raw_ptr_or_raise().end() == deref(self._it):
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef int64_t _label = self._it.get().Pair().Label()
 *     cdef string _symbol = self._it.get().Pair().Symbol()
*/
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "pywrapfst.pyx":1412
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self._table._raw_ptr_or_raise().end() == deref(self._it):             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64_t _label = self._it.get().Pair().Label()
*/
  }

  /* "pywrapfst.pyx":1414
 *     if self._table._raw_ptr_or_raise().end() == deref(self._it):
 *       raise StopIteration
 *     cdef int64_t _label = self._it.get().Pair().Label()             # <<<<<<<<<<<<<<
 *     cdef string _symbol = self._it.get().Pair().Symbol()
 *     inc(deref(self._it))
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
    __PYX_ERR(0, 1414, __pyx_L1_error)
  }
  __pyx_v__label = __pyx_v_self->_it.get()->operator*().Label();

  /* "pywrapfst.pyx":1415
 *       raise StopIteration
 *     cdef int64_t _label = self._it.get().Pair().Label()
 *     cdef string _symbol = self._it.get().Pair().Symbol()             # <<<<<<<<<<<<<<
 *     inc(deref(self._it))
 *     return _label, _symbol
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
    __PYX_ERR(0, 1415, __pyx_L1_error)
  }
  __pyx_v__symbol = __pyx_v_self->_it.get()->operator*().Symbol();

  /* "pywrapfst.pyx":1416
 *     cdef int64_t _label = self._it.get().Pair().Label()
 *     cdef string _symbol = self._it.get().Pair().Symbol()
 *     inc(deref(self._it))             # <<<<<<<<<<<<<<
 *     return _label, _symbol
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
    __PYX_ERR(0, 1416, __pyx_L1_error)
  }
  (void)((++(*__pyx_v_self->_it)));

  /* "pywrapfst.pyx":1417
 *     cdef string _symbol = self._it.get().Pair().Symbol()
 *     inc(deref(self._it))
 *     return _label, _symbol             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyLong_From_int64_t(__pyx_v__label); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v__symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3) != (0)) __PYX_ERR(0, 1417, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4) != (0)) __PYX_ERR(0, 1417, __pyx_L1_error);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1411
 * 
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self._table._raw_ptr_or_raise().end() == deref(self._it):
 *       raise StopIteration
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (!__pyx_error_without_exception) {
    __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;
}

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_20_SymbolTableIterator_8__reduce_cython__(((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._it cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._it cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__it_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._SymbolTableIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_20_SymbolTableIterator_10__setstate_cython__(((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_9pywrapfst_20_SymbolTableIterator_10__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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._it cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__it_cannot_be_converted_to, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __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":1446
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
*/

/* 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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1447
 * 
 *   def __repr__(self):
 *     return f"<EncodeMapper at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_EncodeMapper_at_0x;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1446
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":1449
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type="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;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_arc_type,&__pyx_mstate_global->__pyx_n_u_encode_labels,&__pyx_mstate_global->__pyx_n_u_encode_weights,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1449, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1449, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1449, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1449, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 1449, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_standard));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1449, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1449, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1449, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_standard));
    }
    __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, 1451, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1451
 *   def __init__(self,
 *                arc_type="standard",
 *                bool encode_labels=False,             # <<<<<<<<<<<<<<
 *                bool encode_weights=False):
 *     cdef uint8_t _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, 1452, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1452
 *                arc_type="standard",
 *                bool encode_labels=False,
 *                bool encode_weights=False):             # <<<<<<<<<<<<<<
 *     cdef uint8_t _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._mapper.reset(
*/
      __pyx_v_encode_weights = ((bool)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 1449, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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":1449
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type="standard",
 *                bool encode_labels=False,
*/

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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) {
  uint8_t __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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":1453
 *                bool encode_labels=False,
 *                bool encode_weights=False):
 *     cdef uint8_t _flags = fst.GetEncodeFlags(encode_labels, encode_weights)             # <<<<<<<<<<<<<<
 *     self._mapper.reset(
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
*/
  __pyx_v__flags = fst::script::GetEncodeFlags(__pyx_v_encode_labels, __pyx_v_encode_weights);

  /* "pywrapfst.pyx":1454
 *                bool encode_weights=False):
 *     cdef uint8_t _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._mapper.reset(             # <<<<<<<<<<<<<<
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1454, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1455
 *     cdef uint8_t _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._mapper.reset(
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))             # <<<<<<<<<<<<<<
 *     if self._mapper.get() == NULL:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1455, __pyx_L1_error)

  /* "pywrapfst.pyx":1454
 *                bool encode_weights=False):
 *     cdef uint8_t _flags = fst.GetEncodeFlags(encode_labels, encode_weights)
 *     self._mapper.reset(             # <<<<<<<<<<<<<<
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:
*/
  __pyx_v_self->_mapper.reset(new fst::script::EncodeMapperClass(__pyx_t_1, __pyx_v__flags, fst::ENCODE));

  /* "pywrapfst.pyx":1456
 *     self._mapper.reset(
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1456, __pyx_L1_error)
  }
  __pyx_t_2 = (__pyx_v_self->_mapper.get() == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":1457
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")             # <<<<<<<<<<<<<<
 * 
 *   # Python's equivalent to operator().
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_arc_type), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_arc_type, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1457, __pyx_L1_error)

    /* "pywrapfst.pyx":1456
 *     self._mapper.reset(
 *         new fst.EncodeMapperClass(tostring(arc_type), _flags, fst.ENCODE))
 *     if self._mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 * 
*/
  }

  /* "pywrapfst.pyx":1449
 *     return f"<EncodeMapper at 0x{id(self):x}>"
 * 
 *   def __init__(self,             # <<<<<<<<<<<<<<
 *                arc_type="standard",
 *                bool encode_labels=False,
*/

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

/* "pywrapfst.pyx":1461
 *   # Python's equivalent to operator().
 * 
 *   def __call__(self, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     self(state, ilabel, olabel, weight, nextstate)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_4__call__, "\n    self(state, ilabel, olabel, weight, nextstate)\n\n    Uses the mapper to encode an arc.\n\n    Args:\n      ilabel: The integer index of the input label.\n      olabel: The integer index of the output label.\n      weight: A Weight or weight string indicating the desired final weight; if\n        null, it is set to semiring One.\n      nextstate: The integer index of the destination state.\n\n    Raises:\n      FstOpError: Incompatible or invalid weight.\n    ");
#if CYTHON_UPDATE_DESCRIPTOR_DOC
struct wrapperbase __pyx_wrapperbase_9pywrapfst_12EncodeMapper_4__call__;
#endif
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_arc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1461, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1461, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 1461, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, i); __PYX_ERR(0, 1461, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1461, __pyx_L3_error)
    }
    __pyx_v_arc = ((struct __pyx_obj_9pywrapfst_Arc *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1461, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 1461, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_4__call__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_arc);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_4__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "pywrapfst.pyx":1477
 *       FstOpError: Incompatible or invalid weight.
 *     """
 *     return _init_Arc(self._mapper.get().__call__(deref(arc._arc)))             # <<<<<<<<<<<<<<
 * 
 *   # Registers the class for pickling.
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1477, __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, 1477, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_mapper.get()->operator()((*__pyx_v_arc->_arc)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1461
 *   # 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":1481
 *   # Registers the class for pickling.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *       return _read_EncodeMapper_from_string, (self.write_to_string(),)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_7__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_7__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_7__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_6__reduce__(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_6__reduce__(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pywrapfst.pyx":1482
 * 
 *   def __reduce__(self):
 *       return _read_EncodeMapper_from_string, (self.write_to_string(),)             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_read_EncodeMapper_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1482, __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, 1482, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->write_to_string(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1482, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1482, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1482, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1481
 *   # Registers the class for pickling.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *       return _read_EncodeMapper_from_string, (self.write_to_string(),)
 * 
*/

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

/* "pywrapfst.pyx":1484
 *       return _read_EncodeMapper_from_string, (self.write_to_string(),)
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_9arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static std::string __pyx_f_9pywrapfst_12EncodeMapper_arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_v__string;
  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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12EncodeMapper_9arc_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1484, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1491
 *     """
 *     cdef string _string
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _string = self._mapper.get().ArcType()
 *     return _string
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1492
 *     cdef string _string
 *     with nogil:
 *       _string = self._mapper.get().ArcType()             # <<<<<<<<<<<<<<
 *     return _string
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1492, __pyx_L4_error)
        }
        __pyx_v__string = __pyx_v_self->_mapper.get()->ArcType();
      }

      /* "pywrapfst.pyx":1491
 *     """
 *     cdef string _string
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _string = self._mapper.get().ArcType()
 *     return _string
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1493
 *     with nogil:
 *       _string = self._mapper.get().ArcType()
 *     return _string             # <<<<<<<<<<<<<<
 * 
 *   cpdef string weight_type(self):
*/
  __pyx_r = __pyx_v__string;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1484
 *       return _read_EncodeMapper_from_string, (self.write_to_string(),)
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_9arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_8arc_type, "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_9arc_type = {"arc_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_9arc_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_8arc_type};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_9arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("arc_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("arc_type", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_8arc_type(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_8arc_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_12EncodeMapper_arc_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1484, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __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.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":1495
 *     return _string
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
*/

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_11weight_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static std::string __pyx_f_9pywrapfst_12EncodeMapper_weight_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_v__string;
  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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weight_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12EncodeMapper_11weight_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1502
 *     """
 *     cdef string _string
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _string = self._mapper.get().WeightType()
 *     return _string
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1503
 *     cdef string _string
 *     with nogil:
 *       _string = self._mapper.get().WeightType()             # <<<<<<<<<<<<<<
 *     return _string
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1503, __pyx_L4_error)
        }
        __pyx_v__string = __pyx_v_self->_mapper.get()->WeightType();
      }

      /* "pywrapfst.pyx":1502
 *     """
 *     cdef string _string
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _string = self._mapper.get().WeightType()
 *     return _string
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1504
 *     with nogil:
 *       _string = self._mapper.get().WeightType()
 *     return _string             # <<<<<<<<<<<<<<
 * 
 *   def flags(self):
*/
  __pyx_r = __pyx_v__string;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1495
 *     return _string
 * 
 *   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_AddTraceback("pywrapfst.EncodeMapper.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_11weight_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_10weight_type, "\n    weight_type(self)\n\n    Returns a string indicating the weight type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_11weight_type = {"weight_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_11weight_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_10weight_type};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_11weight_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("weight_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("weight_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("weight_type", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_10weight_type(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_10weight_type(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weight_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_12EncodeMapper_weight_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __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.EncodeMapper.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1506
 *     return _string
 * 
 *   def flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_13flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_12flags, "\n    flags(self)\n\n    Returns the mapper's flags.\n\n    Returns:\n      A bitmask.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_13flags = {"flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_13flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_12flags};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_13flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("flags", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("flags", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_12flags(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_12flags(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  uint8_t __pyx_v__flags;
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flags", 0);

  /* "pywrapfst.pyx":1516
 *     """
 *     cdef uint8_t _flags
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _flags = self._mapper.get().Flags()
 *     return EncodeMapperFlags(_flags)
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1517
 *     cdef uint8_t _flags
 *     with nogil:
 *       _flags = self._mapper.get().Flags()             # <<<<<<<<<<<<<<
 *     return EncodeMapperFlags(_flags)
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1517, __pyx_L4_error)
        }
        __pyx_v__flags = __pyx_v_self->_mapper.get()->Flags();
      }

      /* "pywrapfst.pyx":1516
 *     """
 *     cdef uint8_t _flags
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _flags = self._mapper.get().Flags()
 *     return EncodeMapperFlags(_flags)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1518
 *     with nogil:
 *       _flags = self._mapper.get().Flags()
 *     return EncodeMapperFlags(_flags)             # <<<<<<<<<<<<<<
 * 
 *   cdef uint64_t _properties(self, uint64_t mask):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_EncodeMapperFlags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_uint8_t(__pyx_v__flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1506
 *     return _string
 * 
 *   def 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_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":1520
 *     return EncodeMapperFlags(_flags)
 * 
 *   cdef uint64_t _properties(self, uint64_t mask):             # <<<<<<<<<<<<<<
 *     cdef uint64_t _props
 *     with nogil:
*/

static uint64_t __pyx_f_9pywrapfst_12EncodeMapper__properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, uint64_t __pyx_v_mask) {
  uint64_t __pyx_v__props;
  uint64_t __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":1522
 *   cdef uint64_t _properties(self, uint64_t mask):
 *     cdef uint64_t _props
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _props = self._mapper.get().Properties(mask)
 *     return _props
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1523
 *     cdef uint64_t _props
 *     with nogil:
 *       _props = self._mapper.get().Properties(mask)             # <<<<<<<<<<<<<<
 *     return _props
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1523, __pyx_L4_error)
        }
        __pyx_v__props = __pyx_v_self->_mapper.get()->Properties(__pyx_v_mask);
      }

      /* "pywrapfst.pyx":1522
 *   cdef uint64_t _properties(self, uint64_t mask):
 *     cdef uint64_t _props
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _props = self._mapper.get().Properties(mask)
 *     return _props
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1524
 *     with nogil:
 *       _props = self._mapper.get().Properties(mask)
 *     return _props             # <<<<<<<<<<<<<<
 * 
 *   def properties(self, mask):
*/
  __pyx_r = __pyx_v__props;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1520
 *     return EncodeMapperFlags(_flags)
 * 
 *   cdef uint64_t _properties(self, uint64_t mask):             # <<<<<<<<<<<<<<
 *     cdef uint64_t _props
 *     with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.EncodeMapper._properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "pywrapfst.pyx":1526
 *     return _props
 * 
 *   def properties(self, mask):             # <<<<<<<<<<<<<<
 *     """properties(self, mask)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_14properties, "properties(self, mask)\n\n    Returns the mapper's properties.\n\n    Returns:\n      A bitmask.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_15properties = {"properties", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_15properties, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_14properties};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_15properties(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_mask = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("properties (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mask,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1526, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1526, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "properties", 0) < 0) __PYX_ERR(0, 1526, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("properties", 1, 1, 1, i); __PYX_ERR(0, 1526, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1526, __pyx_L3_error)
    }
    __pyx_v_mask = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("properties", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1526, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_v_mask);

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_14properties(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_mask) {
  uint64_t __pyx_v__mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint64_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("properties", 0);

  /* "pywrapfst.pyx":1534
 *       A bitmask.
 *     """
 *     cdef uint64_t _mask = mask.value             # <<<<<<<<<<<<<<
 *     return FstProperties(self._properties(_mask))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1534, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__mask = __pyx_t_2;

  /* "pywrapfst.pyx":1535
 *     """
 *     cdef uint64_t _mask = mask.value
 *     return FstProperties(self._properties(_mask))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_properties");
    __PYX_ERR(0, 1535, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_properties(__pyx_v_self, __pyx_v__mask); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1535, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    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;

  /* "pywrapfst.pyx":1526
 *     return _props
 * 
 *   def properties(self, mask):             # <<<<<<<<<<<<<<
 *     """properties(self, mask)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":1537
 *     return FstProperties(self._properties(_mask))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_17read(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_16read, "\n    EncodeMapper.read(source)\n\n    Reads encode mapper from binary file.\n\n    This class method creates a new EncodeMapper from an encode mapper binary\n    file.\n\n    Args:\n      source: The string location of the input binary file.\n\n    Returns:\n      A new EncodeMapper instance.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_17read = {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_17read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_16read};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_17read(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1537, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1537, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read", 0) < 0) __PYX_ERR(0, 1537, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, i); __PYX_ERR(0, 1537, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1537, __pyx_L3_error)
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1537, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_16read(((PyTypeObject*)__pyx_v_cls), __pyx_v_source);

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_16read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  std::string __pyx_v__source;
  std::unique_ptr<fst::script::EncodeMapperClass>  __pyx_v__mapper;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pywrapfst.pyx":1553
 *       A new EncodeMapper instance.
 *     """
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *     with nogil:
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1553, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":1555
 *     cdef string _source = path_tostring(source)
 *     cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _mapper = fst.EncodeMapperClass.Read(_source)
 *     if _mapper.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1556
 *     cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *     with nogil:
 *       _mapper = fst.EncodeMapperClass.Read(_source)             # <<<<<<<<<<<<<<
 *     if _mapper.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
*/
        __pyx_v__mapper = fst::script::EncodeMapperClass::Read(__pyx_v__source);
      }

      /* "pywrapfst.pyx":1555
 *     cdef string _source = path_tostring(source)
 *     cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _mapper = fst.EncodeMapperClass.Read(_source)
 *     if _mapper.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1557
 *     with nogil:
 *       _mapper = fst.EncodeMapperClass.Read(_source)
 *     if _mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_EncodeMapper(_mapper.release())
*/
  __pyx_t_2 = (__pyx_v__mapper.get() == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":1558
 *       _mapper = fst.EncodeMapperClass.Read(_source)
 *     if _mapper.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")             # <<<<<<<<<<<<<<
 *     return _init_EncodeMapper(_mapper.release())
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Read_failed, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1558, __pyx_L1_error)

    /* "pywrapfst.pyx":1557
 *     with nogil:
 *       _mapper = fst.EncodeMapperClass.Read(_source)
 *     if _mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_EncodeMapper(_mapper.release())
*/
  }

  /* "pywrapfst.pyx":1559
 *     if _mapper.get() == NULL:
 *       raise FstIOError(f"Read failed: {source!r}")
 *     return _init_EncodeMapper(_mapper.release())             # <<<<<<<<<<<<<<
 * 
 *   @staticmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_v__mapper.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1559, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1537
 *     return FstProperties(self._properties(_mask))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/

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

/* "pywrapfst.pyx":1561
 *     return _init_EncodeMapper(_mapper.release())
 * 
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   def read_from_string(state):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_19read_from_string(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_18read_from_string, "\n    read_from_string(state)\n\n    Reads an EncodeMapper from a serialized string.\n\n    Args:\n      state: A string containing the serialized EncodeMapper.\n\n    Returns:\n      An EncodeMapper object.\n\n    Raises:\n      FstIOError: Read failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_19read_from_string = {"read_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_19read_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_18read_from_string};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_19read_from_string(CYTHON_UNUSED PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_from_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1561, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1561, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read_from_string", 0) < 0) __PYX_ERR(0, 1561, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_from_string", 1, 1, 1, i); __PYX_ERR(0, 1561, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1561, __pyx_L3_error)
    }
    __pyx_v_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1561, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_18read_from_string(__pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_18read_from_string(PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_from_string", 0);

  /* "pywrapfst.pyx":1577
 *       FstIOError: Read failed.
 *     """
 *     return _read_EncodeMapper_from_string(state)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write(self, source) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1577, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__read_EncodeMapper_from_string(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1), 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1561
 *     return _init_EncodeMapper(_mapper.release())
 * 
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   def read_from_string(state):
 *     """
*/

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

/* "pywrapfst.pyx":1579
 *     return _read_EncodeMapper_from_string(state)
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *       """
 *       write(self, source)
*/

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_21write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_12EncodeMapper_write(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
  std::string __pyx_v__source;
  bool __pyx_v__result;
  __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;
  std::string __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12EncodeMapper_21write)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_source};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1579, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1592
 *         FstIOError: Write failed.
 *       """
 *       cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *       cdef bool _result
 *       with nogil:
*/
  __pyx_t_6 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1592, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pywrapfst.pyx":1594
 *       cdef string _source = path_tostring(source)
 *       cdef bool _result
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mapper.get().Write(_source)
 *       if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1595
 *       cdef bool _result
 *       with nogil:
 *         _result = self._mapper.get().Write(_source)             # <<<<<<<<<<<<<<
 *       if not _result:
 *         raise FstIOError(f"Write failed: {source!r}")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1595, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_self->_mapper.get()->Write(__pyx_v__source);
      }

      /* "pywrapfst.pyx":1594
 *       cdef string _source = path_tostring(source)
 *       cdef bool _result
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mapper.get().Write(_source)
 *       if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1596
 *       with nogil:
 *         _result = self._mapper.get().Write(_source)
 *       if not _result:             # <<<<<<<<<<<<<<
 *         raise FstIOError(f"Write failed: {source!r}")
 * 
*/
  __pyx_t_7 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":1597
 *         _result = self._mapper.get().Write(_source)
 *       if not _result:
 *         raise FstIOError(f"Write failed: {source!r}")             # <<<<<<<<<<<<<<
 * 
 *   cpdef bytes write_to_string(self):
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1597, __pyx_L1_error)

    /* "pywrapfst.pyx":1596
 *       with nogil:
 *         _result = self._mapper.get().Write(_source)
 *       if not _result:             # <<<<<<<<<<<<<<
 *         raise FstIOError(f"Write failed: {source!r}")
 * 
*/
  }

  /* "pywrapfst.pyx":1579
 *     return _read_EncodeMapper_from_string(state)
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *       """
 *       write(self, source)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_21write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_20write, "\n      write(self, source)\n\n      Serializes mapper to a file.\n\n      This method writes the mapper to a file in a binary format.\n\n      Args:\n        source: The string location of the output file.\n      Raises:\n        FstIOError: Write failed.\n      ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_21write = {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_21write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_20write};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_21write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1579, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1579, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "write", 0) < 0) __PYX_ERR(0, 1579, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, i); __PYX_ERR(0, 1579, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1579, __pyx_L3_error)
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1579, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_20write(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_source);

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_20write(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_12EncodeMapper_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1579, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1579, __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.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_23write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_9pywrapfst_12EncodeMapper_write_to_string(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  bool __pyx_v__result;
  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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12EncodeMapper_23write_to_string)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 1599, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1613
 *       cdef stringstream _sstrm
 *       cdef bool _result
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>")
 *       if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1614
 *       cdef bool _result
 *       with nogil:
 *         _result = self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>")             # <<<<<<<<<<<<<<
 *       if not _result:
 *         raise FstIOError("Write to string failed")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1614, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_self->_mapper.get()->Write(__pyx_v__sstrm, __pyx_k_pywrapfst);
      }

      /* "pywrapfst.pyx":1613
 *       cdef stringstream _sstrm
 *       cdef bool _result
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>")
 *       if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1615
 *       with nogil:
 *         _result = self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>")
 *       if not _result:             # <<<<<<<<<<<<<<
 *         raise FstIOError("Write to string failed")
 *       return _sstrm.str()
*/
  __pyx_t_6 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_6)) {

    /* "pywrapfst.pyx":1616
 *         _result = self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>")
 *       if not _result:
 *         raise FstIOError("Write to string failed")             # <<<<<<<<<<<<<<
 *       return _sstrm.str()
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Write_to_string_failed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1616, __pyx_L1_error)

    /* "pywrapfst.pyx":1615
 *       with nogil:
 *         _result = self._mapper.get().WriteStream(_sstrm, b"<pywrapfst>")
 *       if not _result:             # <<<<<<<<<<<<<<
 *         raise FstIOError("Write to string failed")
 *       return _sstrm.str()
*/
  }

  /* "pywrapfst.pyx":1617
 *       if not _result:
 *         raise FstIOError("Write to string failed")
 *       return _sstrm.str()             # <<<<<<<<<<<<<<
 * 
 *   cpdef _EncodeMapperSymbolTableView input_symbols(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_6libcpp_6string_std__in_string(__pyx_v__sstrm.str()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_23write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_22write_to_string, "\n      write_to_string(self)\n\n      Serializes mapper to a string.\n\n      Returns:\n        A bytestring.\n\n      Raises:\n        FstIOError: Write to string failed.\n      ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_23write_to_string = {"write_to_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_23write_to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_22write_to_string};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_23write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("write_to_string", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("write_to_string", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_22write_to_string(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_22write_to_string(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_12EncodeMapper_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1599, __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.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":1619
 *       return _sstrm.str()
 * 
 *   cpdef _EncodeMapperSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
*/

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_25input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("input_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12EncodeMapper_25input_symbols)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1619, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1619, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1625
 *     Returns the mapper's input symbol table, or None if none is present.
 *     """
 *     if self._mapper.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1625, __pyx_L1_error)
  }
  __pyx_t_6 = (__pyx_v_self->_mapper.get()->InputSymbols() == NULL);
  if (__pyx_t_6) {

    /* "pywrapfst.pyx":1626
 *     """
 *     if self._mapper.get().InputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 * 
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":1625
 *     Returns the mapper's input symbol table, or None if none is present.
 *     """
 *     if self._mapper.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
*/
  }

  /* "pywrapfst.pyx":1627
 *     if self._mapper.get().InputSymbols() == NULL:
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)             # <<<<<<<<<<<<<<
 * 
 *   cpdef _EncodeMapperSymbolTableView output_symbols(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1627, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(__pyx_v_self->_mapper, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1619
 *       return _sstrm.str()
 * 
 *   cpdef _EncodeMapperSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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_25input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_24input_symbols, "\n    input_symbols(self)\n\n    Returns the mapper's input symbol table, or None if none is present.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_25input_symbols = {"input_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_25input_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_24input_symbols};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_25input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("input_symbols", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("input_symbols", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_24input_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_24input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("input_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12EncodeMapper_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1619, __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":1629
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 * 
 *   cpdef _EncodeMapperSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
*/

static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_27output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("output_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12EncodeMapper_27output_symbols)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1629, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView))))) __PYX_ERR(0, 1629, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1635
 *     Returns the mapper's output symbol table, or None if none is present.
 *     """
 *     if self._mapper.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1635, __pyx_L1_error)
  }
  __pyx_t_6 = (__pyx_v_self->_mapper.get()->OutputSymbols() == NULL);
  if (__pyx_t_6) {

    /* "pywrapfst.pyx":1636
 *     """
 *     if self._mapper.get().OutputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
 * 
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":1635
 *     Returns the mapper's output symbol table, or None if none is present.
 *     """
 *     if self._mapper.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
*/
  }

  /* "pywrapfst.pyx":1637
 *     if self._mapper.get().OutputSymbols() == NULL:
 *       return
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1637, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView(__pyx_v_self->_mapper, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1629
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 * 
 *   cpdef _EncodeMapperSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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_27output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_26output_symbols, "\n    output_symbols(self)\n\n    Returns the mapper's output symbol table, or None if none is present.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_27output_symbols = {"output_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_27output_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_26output_symbols};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_27output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("output_symbols", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("output_symbols", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_26output_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_26output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("output_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_12EncodeMapper_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1629, __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":1639
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:
*/

static void __pyx_f_9pywrapfst_12EncodeMapper__set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_ptr;
  int __pyx_t_1;
  fst::SymbolTable const *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":1640
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     cdef const_SymbolTable_ptr ptr = NULL             # <<<<<<<<<<<<<<
 *     if symbols is not None:
 *       ptr = symbols._raw_ptr_or_raise()
*/
  __pyx_v_ptr = NULL;

  /* "pywrapfst.pyx":1641
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:             # <<<<<<<<<<<<<<
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_symbols) != Py_None);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":1642
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:
 *       ptr = symbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     with nogil:
 *       self._mapper.get().SetInputSymbols(ptr)
*/
    if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1642, __pyx_L1_error)
    }
    __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1642, __pyx_L1_error)
    __pyx_v_ptr = __pyx_t_2;

    /* "pywrapfst.pyx":1641
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:             # <<<<<<<<<<<<<<
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:
*/
  }

  /* "pywrapfst.pyx":1643
 *     if symbols is not None:
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mapper.get().SetInputSymbols(ptr)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1644
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:
 *       self._mapper.get().SetInputSymbols(ptr)             # <<<<<<<<<<<<<<
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1644, __pyx_L5_error)
        }
        __pyx_v_self->_mapper.get()->SetInputSymbols(__pyx_v_ptr);
      }

      /* "pywrapfst.pyx":1643
 *     if symbols is not None:
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mapper.get().SetInputSymbols(ptr)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pywrapfst.pyx":1639
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=False)
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.EncodeMapper._set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":1646
 *       self._mapper.get().SetInputSymbols(ptr)
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_29set_input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_28set_input_symbols, "\n    set_input_symbols(self, symbols)\n\n    Sets the mapper's input symbol table.\n\n    Passing None as a value will delete the input symbol table.\n\n    Args:\n      symbols: A SymbolTable.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_29set_input_symbols = {"set_input_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_29set_input_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_28set_input_symbols};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_29set_input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symbols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1646, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1646, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_input_symbols", 0) < 0) __PYX_ERR(0, 1646, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_input_symbols", 1, 1, 1, i); __PYX_ERR(0, 1646, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1646, __pyx_L3_error)
    }
    __pyx_v_symbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_input_symbols", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1646, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1646, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_symbols);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_28set_input_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_input_symbols", 0);

  /* "pywrapfst.pyx":1660
 *       self.
 *     """
 *     self._set_input_symbols(symbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
    __PYX_ERR(0, 1660, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1660, __pyx_L1_error)

  /* "pywrapfst.pyx":1661
 *     """
 *     self._set_input_symbols(symbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1646
 *       self._mapper.get().SetInputSymbols(ptr)
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
*/

  /* function exit code */
  __pyx_L1_error:;
  __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":1663
 *     return self
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:
*/

static void __pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  __pyx_t_9pywrapfst_const_SymbolTable_ptr __pyx_v_ptr;
  int __pyx_t_1;
  fst::SymbolTable const *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":1664
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     cdef const_SymbolTable_ptr ptr = NULL             # <<<<<<<<<<<<<<
 *     if symbols is not None:
 *       ptr = symbols._raw_ptr_or_raise()
*/
  __pyx_v_ptr = NULL;

  /* "pywrapfst.pyx":1665
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:             # <<<<<<<<<<<<<<
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_symbols) != Py_None);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":1666
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:
 *       ptr = symbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     with nogil:
 *       self._mapper.get().SetOutputSymbols(ptr)
*/
    if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1666, __pyx_L1_error)
    }
    __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1666, __pyx_L1_error)
    __pyx_v_ptr = __pyx_t_2;

    /* "pywrapfst.pyx":1665
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:             # <<<<<<<<<<<<<<
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:
*/
  }

  /* "pywrapfst.pyx":1667
 *     if symbols is not None:
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mapper.get().SetOutputSymbols(ptr)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1668
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:
 *       self._mapper.get().SetOutputSymbols(ptr)             # <<<<<<<<<<<<<<
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1668, __pyx_L5_error)
        }
        __pyx_v_self->_mapper.get()->SetOutputSymbols(__pyx_v_ptr);
      }

      /* "pywrapfst.pyx":1667
 *     if symbols is not None:
 *       ptr = symbols._raw_ptr_or_raise()
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mapper.get().SetOutputSymbols(ptr)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pywrapfst.pyx":1663
 *     return self
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     cdef const_SymbolTable_ptr ptr = NULL
 *     if symbols is not None:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.EncodeMapper._set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":1670
 *       self._mapper.get().SetOutputSymbols(ptr)
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_31set_output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12EncodeMapper_30set_output_symbols, "\n    set_output_symbols(self, symbols)\n\n    Sets the mapper's output symbol table.\n\n    Passing None as a value will delete the output symbol table.\n\n    Args:\n      symbols: A SymbolTable.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12EncodeMapper_31set_output_symbols = {"set_output_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_31set_output_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_30set_output_symbols};
static PyObject *__pyx_pw_9pywrapfst_12EncodeMapper_31set_output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symbols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1670, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1670, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_output_symbols", 0) < 0) __PYX_ERR(0, 1670, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_output_symbols", 1, 1, 1, i); __PYX_ERR(0, 1670, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1670, __pyx_L3_error)
    }
    __pyx_v_symbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_output_symbols", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1670, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.EncodeMapper.set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 1670, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_v_self), __pyx_v_symbols);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_12EncodeMapper_30set_output_symbols(struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_output_symbols", 0);

  /* "pywrapfst.pyx":1684
 *       self.
 *     """
 *     self._set_output_symbols(symbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
    __PYX_ERR(0, 1684, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_EncodeMapper *)__pyx_v_self->__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1684, __pyx_L1_error)

  /* "pywrapfst.pyx":1685
 *     """
 *     self._set_output_symbols(symbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":1670
 *       self._mapper.get().SetOutputSymbols(ptr)
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
*/

  /* function exit code */
  __pyx_L1_error:;
  __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":1688
 * 
 * 
 * cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):             # <<<<<<<<<<<<<<
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
 *   result._mapper.reset(mapper)
*/

static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_t_9pywrapfst_EncodeMapperClass_ptr __pyx_v_mapper) {
  struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_result = 0;
  struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_EncodeMapper", 0);

  /* "pywrapfst.pyx":1689
 * 
 * cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)             # <<<<<<<<<<<<<<
 *   result._mapper.reset(mapper)
 *   return result
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_EncodeMapper(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1689, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1690
 * cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
 *   result._mapper.reset(mapper)             # <<<<<<<<<<<<<<
 *   return result
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_result) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
    __PYX_ERR(0, 1690, __pyx_L1_error)
  }
  __pyx_v_result->_mapper.reset(__pyx_v_mapper);

  /* "pywrapfst.pyx":1691
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
 *   result._mapper.reset(mapper)
 *   return result             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1688
 * 
 * 
 * cdef EncodeMapper _init_EncodeMapper(EncodeMapperClass_ptr mapper):             # <<<<<<<<<<<<<<
 *   cdef EncodeMapper result = EncodeMapper.__new__(EncodeMapper)
 *   result._mapper.reset(mapper)
*/

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

/* "pywrapfst.pyx":1694
 * 
 * 
 * cpdef EncodeMapper _read_EncodeMapper_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/

static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_f_9pywrapfst__read_EncodeMapper_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  std::unique_ptr<fst::script::EncodeMapperClass>  __pyx_v__mapper;
  struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_EncodeMapper_from_string", 0);

  /* "pywrapfst.pyx":1696
 * cpdef EncodeMapper _read_EncodeMapper_from_string(string state):
 *   cdef stringstream _sstrm
 *   _sstrm << state             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *   with nogil:
*/
  (void)((__pyx_v__sstrm << __pyx_v_state));

  /* "pywrapfst.pyx":1698
 *   _sstrm << state
 *   cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _mapper = fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _mapper.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1699
 *   cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *   with nogil:
 *     _mapper = fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>")             # <<<<<<<<<<<<<<
 *   if _mapper.get() == NULL:
 *     raise FstIOError("Read from string failed")
*/
        __pyx_v__mapper = fst::script::EncodeMapperClass::Read(__pyx_v__sstrm, __pyx_k_pywrapfst);
      }

      /* "pywrapfst.pyx":1698
 *   _sstrm << state
 *   cdef unique_ptr[fst.EncodeMapperClass] _mapper
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _mapper = fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _mapper.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1700
 *   with nogil:
 *     _mapper = fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_EncodeMapper(_mapper.release())
*/
  __pyx_t_1 = (__pyx_v__mapper.get() == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":1701
 *     _mapper = fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _mapper.get() == NULL:
 *     raise FstIOError("Read from string failed")             # <<<<<<<<<<<<<<
 *   return _init_EncodeMapper(_mapper.release())
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Read_from_string_failed};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1701, __pyx_L1_error)

    /* "pywrapfst.pyx":1700
 *   with nogil:
 *     _mapper = fst.EncodeMapperClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _mapper.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_EncodeMapper(_mapper.release())
*/
  }

  /* "pywrapfst.pyx":1702
 *   if _mapper.get() == NULL:
 *     raise FstIOError("Read from string failed")
 *   return _init_EncodeMapper(_mapper.release())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_EncodeMapper(__pyx_v__mapper.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1694
 * 
 * 
 * cpdef EncodeMapper _read_EncodeMapper_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst._read_EncodeMapper_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_15_read_EncodeMapper_from_string = {"_read_EncodeMapper_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_15_read_EncodeMapper_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  std::string __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_EncodeMapper_from_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1694, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1694, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_read_EncodeMapper_from_string", 0) < 0) __PYX_ERR(0, 1694, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_read_EncodeMapper_from_string", 1, 1, 1, i); __PYX_ERR(0, 1694, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1694, __pyx_L3_error)
    }
    __pyx_v_state = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1694, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_read_EncodeMapper_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1694, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._read_EncodeMapper_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(__pyx_self, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_14_read_EncodeMapper_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_EncodeMapper_from_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_EncodeMapper_from_string(__pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1694, __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_EncodeMapper_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1728
 * 
 *   # copybara:strip_begin
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   cdef string _server_render_svg(const string &dot):
 *     # Creates request.
*/

static std::string __pyx_f_9pywrapfst_3Fst__server_render_svg(std::string const &__pyx_v_dot) {
  PyObject *__pyx_v_request = NULL;
  PyObject *__pyx_v_response = NULL;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_server_render_svg", 0);

  /* "pywrapfst.pyx":1731
 *   cdef string _server_render_svg(const string &dot):
 *     # Creates request.
 *     request = graphviz_server_pb2.RenderRequest()             # <<<<<<<<<<<<<<
 *     request.graph.dot = dot
 *     request.return_bytes = True
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_graphviz_server_pb2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_RenderRequest); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_request = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1732
 *     # Creates request.
 *     request = graphviz_server_pb2.RenderRequest()
 *     request.graph.dot = dot             # <<<<<<<<<<<<<<
 *     request.return_bytes = True
 *     # Makes request and returns SVG rendering.
*/
  __pyx_t_1 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_dot); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_request, __pyx_mstate_global->__pyx_n_u_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_dot, __pyx_t_1) < 0) __PYX_ERR(0, 1732, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "pywrapfst.pyx":1733
 *     request = graphviz_server_pb2.RenderRequest()
 *     request.graph.dot = dot
 *     request.return_bytes = True             # <<<<<<<<<<<<<<
 *     # Makes request and returns SVG rendering.
 *     response = stubby.Call("blade:graphviz-server",
*/
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_request, __pyx_mstate_global->__pyx_n_u_return_bytes, Py_True) < 0) __PYX_ERR(0, 1733, __pyx_L1_error)

  /* "pywrapfst.pyx":1735
 *     request.return_bytes = True
 *     # Makes request and returns SVG rendering.
 *     response = stubby.Call("blade:graphviz-server",             # <<<<<<<<<<<<<<
 *                            "RenderServer.Render",
 *                            request)
*/
  __pyx_t_1 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stubby); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Call); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1737
 *     response = stubby.Call("blade:graphviz-server",
 *                            "RenderServer.Render",
 *                            request)             # <<<<<<<<<<<<<<
 *     return response.rendered_graph.rendered_bytes
 *   # copybara:strip_end
*/
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_1);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[4] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_blade_graphviz_server, __pyx_mstate_global->__pyx_kp_u_RenderServer_Render, __pyx_v_request};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (4-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  }
  __pyx_v_response = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "pywrapfst.pyx":1738
 *                            "RenderServer.Render",
 *                            request)
 *     return response.rendered_graph.rendered_bytes             # <<<<<<<<<<<<<<
 *   # copybara:strip_end
 * 
*/
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_response, __pyx_mstate_global->__pyx_n_u_rendered_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_rendered_bytes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1738, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1728
 * 
 *   # copybara:strip_begin
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   cdef string _server_render_svg(const string &dot):
 *     # Creates request.
*/

  /* 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._server_render_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_request);
  __Pyx_XDECREF(__pyx_v_response);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1741
 *   # copybara:strip_end
 * 
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   cdef string _local_render_svg(const string &dot):
 *     # As suggested in the following, we now use the Cairo renderer:
*/

static std::string __pyx_f_9pywrapfst_3Fst__local_render_svg(std::string const &__pyx_v_dot) {
  PyObject *__pyx_v_proc = NULL;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  std::string __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_local_render_svg", 0);

  /* "pywrapfst.pyx":1745
 *     # As suggested in the following, we now use the Cairo renderer:
 *     # https://github.com/kylebgorman/pynini/issues/35
 *     proc = subprocess.Popen(["dot", "-Tsvg:cairo"],             # <<<<<<<<<<<<<<
 *                             stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE)
*/
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_subprocess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_Popen); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyList_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_dot);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_dot);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 0, __pyx_mstate_global->__pyx_n_u_dot) != (0)) __PYX_ERR(0, 1745, __pyx_L1_error);
  __Pyx_INCREF(__pyx_mstate_global->__pyx_kp_u_Tsvg_cairo);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_kp_u_Tsvg_cairo);
  if (__Pyx_PyList_SET_ITEM(__pyx_t_3, 1, __pyx_mstate_global->__pyx_kp_u_Tsvg_cairo) != (0)) __PYX_ERR(0, 1745, __pyx_L1_error);

  /* "pywrapfst.pyx":1746
 *     # https://github.com/kylebgorman/pynini/issues/35
 *     proc = subprocess.Popen(["dot", "-Tsvg:cairo"],
 *                             stdin=subprocess.PIPE,             # <<<<<<<<<<<<<<
 *                             stdout=subprocess.PIPE)
 *     return proc.communicate(dot.encode("utf8"))[0]
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PIPE); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1747
 *     proc = subprocess.Popen(["dot", "-Tsvg:cairo"],
 *                             stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE)             # <<<<<<<<<<<<<<
 *     return proc.communicate(dot.encode("utf8"))[0]
 * 
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_subprocess); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_PIPE); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_8 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2 + ((CYTHON_VECTORCALL) ? 2 : 0)] = {__pyx_t_2, __pyx_t_3};
    __pyx_t_5 = __Pyx_MakeVectorcallBuilderKwds(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_stdin, __pyx_t_6, __pyx_t_5, __pyx_callargs+2, 0) < 0) __PYX_ERR(0, 1745, __pyx_L1_error)
    if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_stdout, __pyx_t_7, __pyx_t_5, __pyx_callargs+2, 1) < 0) __PYX_ERR(0, 1745, __pyx_L1_error)
    __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_4, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_v_proc = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1748
 *                             stdin=subprocess.PIPE,
 *                             stdout=subprocess.PIPE)
 *     return proc.communicate(dot.encode("utf8"))[0]             # <<<<<<<<<<<<<<
 * 
 *   def _repr_svg_(self):
*/
  __pyx_t_4 = __pyx_v_proc;
  __Pyx_INCREF(__pyx_t_4);
  __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_dot); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyUnicode_AsUTF8String(((PyObject*)__pyx_t_5)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_8 = 0;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_communicate, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1748, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1748, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_9;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1741
 *   # copybara:strip_end
 * 
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   cdef string _local_render_svg(const string &dot):
 *     # As suggested in the following, we now use the Cairo renderer:
*/

  /* 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._local_render_svg", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_proc);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1750
 *     return proc.communicate(dot.encode("utf8"))[0]
 * 
 *   def _repr_svg_(self):             # <<<<<<<<<<<<<<
 *     """IPython notebook magic to produce an SVG of the FST using GraphViz.
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_1_repr_svg_(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst__repr_svg_, "IPython notebook magic to produce an SVG of the FST using GraphViz.\n\n    This method produces an SVG of the internal graph. Users wishing to create\n    publication-quality graphs should instead use the method `draw`, which\n    exposes additional parameters.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_1_repr_svg_ = {"_repr_svg_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_1_repr_svg_, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst__repr_svg_};
static PyObject *__pyx_pw_9pywrapfst_3Fst_1_repr_svg_(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_repr_svg_ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("_repr_svg_", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("_repr_svg_", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst__repr_svg_(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst__repr_svg_(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  std::stringstream __pyx_v__sstrm;
  bool __pyx_v_acceptor;
  PyObject *__pyx_v_e = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  std::string __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  size_t __pyx_t_14;
  int __pyx_t_15;
  char const *__pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  char const *__pyx_t_23;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_repr_svg_", 0);

  /* "pywrapfst.pyx":1758
 *     """
 *     cdef stringstream _sstrm
 *     cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==             # <<<<<<<<<<<<<<
 *                           fst.kAcceptor)
 *     with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1758, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":1759
 *     cdef stringstream _sstrm
 *     cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
 *                           fst.kAcceptor)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Draw(deref(self._fst),
*/
  __pyx_v_acceptor = (__pyx_v_self->_fst.get()->Properties(fst::kAcceptor, 1) == fst::kAcceptor);

  /* "pywrapfst.pyx":1760
 *     cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
 *                           fst.kAcceptor)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Draw(deref(self._fst),
 *                self._fst.get().InputSymbols(),
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1761
 *                           fst.kAcceptor)
 *     with nogil:
 *       fst.Draw(deref(self._fst),             # <<<<<<<<<<<<<<
 *                self._fst.get().InputSymbols(),
 *                self._fst.get().OutputSymbols(),
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1761, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":1762
 *     with nogil:
 *       fst.Draw(deref(self._fst),
 *                self._fst.get().InputSymbols(),             # <<<<<<<<<<<<<<
 *                self._fst.get().OutputSymbols(),
 *                NULL,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1762, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":1763
 *       fst.Draw(deref(self._fst),
 *                self._fst.get().InputSymbols(),
 *                self._fst.get().OutputSymbols(),             # <<<<<<<<<<<<<<
 *                NULL,
 *                acceptor,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1763, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":1761
 *                           fst.kAcceptor)
 *     with nogil:
 *       fst.Draw(deref(self._fst),             # <<<<<<<<<<<<<<
 *                self._fst.get().InputSymbols(),
 *                self._fst.get().OutputSymbols(),
*/
        fst::script::Draw((*__pyx_v_self->_fst), __pyx_v_self->_fst.get()->InputSymbols(), __pyx_v_self->_fst.get()->OutputSymbols(), NULL, __pyx_v_acceptor, __pyx_k__6, 8.5, 11.0, 1, 0, 0.4, 0.25, 14, 5, __pyx_k_g, 0, __pyx_k_dot, __pyx_v__sstrm, __pyx_k_pywrapfst);
      }

      /* "pywrapfst.pyx":1760
 *     cdef bool acceptor = (self._fst.get().Properties(fst.kAcceptor, True) ==
 *                           fst.kAcceptor)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Draw(deref(self._fst),
 *                self._fst.get().InputSymbols(),
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1781
 *                b"<pywrapfst>")
 *     # copybara:strip_begin
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._server_render_svg(_sstrm.str())
 *     except Exception as e:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "pywrapfst.pyx":1782
 *     # copybara:strip_begin
 *     try:
 *       return Fst._server_render_svg(_sstrm.str())             # <<<<<<<<<<<<<<
 *     except Exception as e:
 *       frontend.DisplayToast("GraphViz server request failed: " + str(e))
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __pyx_f_9pywrapfst_3Fst__server_render_svg(__pyx_v__sstrm.str()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1782, __pyx_L6_error)
      __pyx_t_5 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1782, __pyx_L6_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L10_try_return;

      /* "pywrapfst.pyx":1781
 *                b"<pywrapfst>")
 *     # copybara:strip_begin
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._server_render_svg(_sstrm.str())
 *     except Exception as e:
*/
    }
    __pyx_L6_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pywrapfst.pyx":1783
 *     try:
 *       return Fst._server_render_svg(_sstrm.str())
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *       frontend.DisplayToast("GraphViz server request failed: " + str(e))
 *       logging.error("Graphviz server requested failed: %s", e)
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_6) {
      __Pyx_AddTraceback("pywrapfst.Fst._repr_svg_", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 1783, __pyx_L8_except_error)
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_e = __pyx_t_7;
      /*try:*/ {

        /* "pywrapfst.pyx":1784
 *       return Fst._server_render_svg(_sstrm.str())
 *     except Exception as e:
 *       frontend.DisplayToast("GraphViz server request failed: " + str(e))             # <<<<<<<<<<<<<<
 *       logging.error("Graphviz server requested failed: %s", e)
 *     # copybara:strip_end
*/
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_frontend); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_mstate_global->__pyx_n_u_DisplayToast); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1784, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_Unicode(__pyx_v_e); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1784, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_13 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_GraphViz_server_request_failed, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1784, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_14 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_12);
          assert(__pyx_t_10);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_12);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_12, __pyx__function);
          __pyx_t_14 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_10, __pyx_t_13};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1784, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "pywrapfst.pyx":1785
 *     except Exception as e:
 *       frontend.DisplayToast("GraphViz server request failed: " + str(e))
 *       logging.error("Graphviz server requested failed: %s", e)             # <<<<<<<<<<<<<<
 *     # copybara:strip_end
 *     try:
*/
        __pyx_t_12 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1785, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1785, __pyx_L17_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_14 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
          assert(__pyx_t_12);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_10);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_10, __pyx__function);
          __pyx_t_14 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_mstate_global->__pyx_kp_u_Graphviz_server_requested_failed, __pyx_v_e};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1785, __pyx_L17_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "pywrapfst.pyx":1783
 *     try:
 *       return Fst._server_render_svg(_sstrm.str())
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *       frontend.DisplayToast("GraphViz server request failed: " + str(e))
 *       logging.error("Graphviz server requested failed: %s", e)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          goto __pyx_L18;
        }
        __pyx_L17_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
          if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_17);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_22);
          __pyx_t_6 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
          __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
          __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
          goto __pyx_L8_except_error;
        }
        __pyx_L18:;
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L7_exception_handled;
    }
    goto __pyx_L8_except_error;

    /* "pywrapfst.pyx":1781
 *                b"<pywrapfst>")
 *     # copybara:strip_begin
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._server_render_svg(_sstrm.str())
 *     except Exception as e:
*/
    __pyx_L8_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L10_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_L7_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  }

  /* "pywrapfst.pyx":1787
 *       logging.error("Graphviz server requested failed: %s", e)
 *     # copybara:strip_end
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_2, &__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_1);
    /*try:*/ {

      /* "pywrapfst.pyx":1788
 *     # copybara:strip_end
 *     try:
 *       return Fst._local_render_svg(_sstrm.str())             # <<<<<<<<<<<<<<
 *     except Exception as e:
 *       logging.error("Dot rendering failed: %s", e)
*/
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_4 = __pyx_f_9pywrapfst_3Fst__local_render_svg(__pyx_v__sstrm.str()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1788, __pyx_L23_error)
      __pyx_t_8 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1788, __pyx_L23_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_r = __pyx_t_8;
      __pyx_t_8 = 0;
      goto __pyx_L27_try_return;

      /* "pywrapfst.pyx":1787
 *       logging.error("Graphviz server requested failed: %s", e)
 *     # copybara:strip_end
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:
*/
    }
    __pyx_L23_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "pywrapfst.pyx":1789
 *     try:
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *       logging.error("Dot rendering failed: %s", e)
 * 
*/
    __pyx_t_15 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(((PyTypeObject*)PyExc_Exception))));
    if (__pyx_t_15) {
      __Pyx_AddTraceback("pywrapfst.Fst._repr_svg_", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(0, 1789, __pyx_L25_except_error)
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __pyx_v_e = __pyx_t_7;
      /*try:*/ {

        /* "pywrapfst.pyx":1790
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:
 *       logging.error("Dot rendering failed: %s", e)             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self):
*/
        __pyx_t_10 = NULL;
        __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1790, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1790, __pyx_L34_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_14 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_13))) {
          __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_13);
          assert(__pyx_t_10);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_13);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_13, __pyx__function);
          __pyx_t_14 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_10, __pyx_mstate_global->__pyx_kp_u_Dot_rendering_failed_s, __pyx_v_e};
          __pyx_t_9 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+__pyx_t_14, (3-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1790, __pyx_L34_error)
          __Pyx_GOTREF(__pyx_t_9);
        }
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }

      /* "pywrapfst.pyx":1789
 *     try:
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:             # <<<<<<<<<<<<<<
 *       logging.error("Dot rendering failed: %s", e)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          goto __pyx_L35;
        }
        __pyx_L34_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_18, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20) < 0)) __Pyx_ErrFetch(&__pyx_t_22, &__pyx_t_21, &__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_22);
          __Pyx_XGOTREF(__pyx_t_21);
          __Pyx_XGOTREF(__pyx_t_20);
          __Pyx_XGOTREF(__pyx_t_19);
          __Pyx_XGOTREF(__pyx_t_18);
          __Pyx_XGOTREF(__pyx_t_17);
          __pyx_t_15 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_23 = __pyx_filename;
          {
            __Pyx_DECREF(__pyx_v_e); __pyx_v_e = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_19);
          __Pyx_XGIVEREF(__pyx_t_18);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_18, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_22);
          __Pyx_XGIVEREF(__pyx_t_21);
          __Pyx_XGIVEREF(__pyx_t_20);
          __Pyx_ErrRestore(__pyx_t_22, __pyx_t_21, __pyx_t_20);
          __pyx_t_22 = 0; __pyx_t_21 = 0; __pyx_t_20 = 0; __pyx_t_19 = 0; __pyx_t_18 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_15; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_23;
          goto __pyx_L25_except_error;
        }
        __pyx_L35:;
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L24_exception_handled;
    }
    goto __pyx_L25_except_error;

    /* "pywrapfst.pyx":1787
 *       logging.error("Graphviz server requested failed: %s", e)
 *     # copybara:strip_end
 *     try:             # <<<<<<<<<<<<<<
 *       return Fst._local_render_svg(_sstrm.str())
 *     except Exception as e:
*/
    __pyx_L25_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    goto __pyx_L1_error;
    __pyx_L27_try_return:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
    goto __pyx_L0;
    __pyx_L24_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_2, __pyx_t_1);
  }

  /* "pywrapfst.pyx":1750
 *     return proc.communicate(dot.encode("utf8"))[0]
 * 
 *   def _repr_svg_(self):             # <<<<<<<<<<<<<<
 *     """IPython notebook magic to produce an SVG of the FST using GraphViz.
 * 
*/

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __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_AddTraceback("pywrapfst.Fst._repr_svg_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_e);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1792
 *       logging.error("Dot rendering failed: %s", e)
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self._class__.__name__}")
 * 
*/

/* Python wrapper */
static int __pyx_pw_9pywrapfst_3Fst_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_3Fst_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_2__init__(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static int __pyx_pf_9pywrapfst_3Fst_2__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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":1793
 * 
 *   def __init__(self):
 *     raise NotImplementedError(f"Cannot construct {self._class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *   # Registers the class for pickling; must be repeated in any subclass which
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_t_3 = __pyx_builtin_NotImplementedError; 
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Cannot_construct, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 1793, __pyx_L1_error)

  /* "pywrapfst.pyx":1792
 *       logging.error("Dot rendering failed: %s", e)
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self._class__.__name__}")
 * 
*/

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

/* "pywrapfst.pyx":1798
 *   # can't be derived by _init_XFst.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return _read_Fst_from_string, (self.write_to_string(),)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_5__reduce__ = {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_3Fst_5__reduce__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_4__reduce__(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_4__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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "pywrapfst.pyx":1799
 * 
 *   def __reduce__(self):
 *     return _read_Fst_from_string, (self.write_to_string(),)             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_read_Fst_from_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __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, 1799, __pyx_L1_error)
  }
  __pyx_t_2 = ((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, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2) != (0)) __PYX_ERR(0, 1799, __pyx_L1_error);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 1799, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3) != (0)) __PYX_ERR(0, 1799, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1798
 *   # can't be derived by _init_XFst.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return _read_Fst_from_string, (self.write_to_string(),)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("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":1801
 *     return _read_Fst_from_string, (self.write_to_string(),)
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_3Fst_7__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_6__repr__(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_6__repr__(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":1802
 * 
 *   def __repr__(self):
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __str__(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "fst_type");
    __PYX_ERR(0, 1802, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->fst_type(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1802, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_5[1] = __pyx_t_2;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_Fst_at_0x;
  __pyx_t_5[3] = __pyx_t_4;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1801
 *     return _read_Fst_from_string, (self.write_to_string(),)
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":1804
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.print()
 * 
*/

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

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_8__str__(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "pywrapfst.pyx":1805
 * 
 *   def __str__(self):
 *     return self.print()             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "print");
    __PYX_ERR(0, 1805, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->print(__pyx_v_self, 0, NULL); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1805, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1804
 *     return f"<{self.fst_type()} Fst at 0x{id(self):x}>"
 * 
 *   def __str__(self):             # <<<<<<<<<<<<<<
 *     return self.print()
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("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":1807
 *     return self.print()
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_11arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static std::string __pyx_f_9pywrapfst_3Fst_arc_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_v__string;
  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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1807, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_11arc_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1807, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1814
 *     """
 *     cdef string _string
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _string = self._fst.get().ArcType()
 *     return _string
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1815
 *     cdef string _string
 *     with nogil:
 *       _string = self._fst.get().ArcType()             # <<<<<<<<<<<<<<
 *     return _string
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1815, __pyx_L4_error)
        }
        __pyx_v__string = __pyx_v_self->_fst.get()->ArcType();
      }

      /* "pywrapfst.pyx":1814
 *     """
 *     cdef string _string
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _string = self._fst.get().ArcType()
 *     return _string
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1816
 *     with nogil:
 *       _string = self._fst.get().ArcType()
 *     return _string             # <<<<<<<<<<<<<<
 * 
 *   cpdef _ArcIterator arcs(self, int64_t state):
*/
  __pyx_r = __pyx_v__string;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1807
 *     return self.print()
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_11arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_10arc_type, "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_11arc_type = {"arc_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_11arc_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_10arc_type};
static PyObject *__pyx_pw_9pywrapfst_3Fst_11arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("arc_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("arc_type", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_10arc_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_10arc_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_arc_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1807, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1807, __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.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1818
 *     return _string
 * 
 *   cpdef _ArcIterator arcs(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     arcs(self, state)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_13arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_f_9pywrapfst_3Fst_arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1818, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_13arcs)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1818, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator))))) __PYX_ERR(0, 1818, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1830
 *       An _ArcIterator.
 *     """
 *     return _ArcIterator(self, state)             # <<<<<<<<<<<<<<
 * 
 *   cpdef Fst copy(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator); 
  __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1830, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1818
 *     return _string
 * 
 *   cpdef _ArcIterator arcs(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     arcs(self, state)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("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_3Fst_13arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_12arcs, "\n    arcs(self, state)\n\n    Returns an iterator over arcs leaving the specified state.\n\n    Args:\n      state: The source state ID.\n\n    Returns:\n      An _ArcIterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_13arcs = {"arcs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_13arcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_12arcs};
static PyObject *__pyx_pw_9pywrapfst_3Fst_13arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arcs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1818, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "arcs", 0) < 0) __PYX_ERR(0, 1818, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("arcs", 1, 1, 1, i); __PYX_ERR(0, 1818, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1818, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1818, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arcs", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1818, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_3Fst_12arcs(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_12arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1818, __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":1832
 *     return _ArcIterator(self, state)
 * 
 *   cpdef Fst copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_15copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst_3Fst_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_15copy)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1832, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 1832, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1838
 *     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, 1838, __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, 1838, __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":1832
 *     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_3Fst_15copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_14copy, "\n    copy(self)\n\n    Makes a copy of the FST.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_15copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_15copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_14copy};
static PyObject *__pyx_pw_9pywrapfst_3Fst_15copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_14copy(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_14copy(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1832, __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":1840
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_17draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_3Fst_draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_draw *__pyx_optional_args) {

  /* "pywrapfst.pyx":1842
 *   cpdef void draw(self,
 *                   source,
 *                   SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
*/
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);

  /* "pywrapfst.pyx":1843
 *                   source,
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,
*/
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);

  /* "pywrapfst.pyx":1844
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *                   bool acceptor=False,
 *                   title="",
*/
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);

  /* "pywrapfst.pyx":1845
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,             # <<<<<<<<<<<<<<
 *                   title="",
 *                   double width=8.5,
*/
  bool __pyx_v_acceptor = ((bool)0);
  PyObject *__pyx_v_title = ((PyObject *)__pyx_mstate_global->__pyx_kp_u__6);
  double __pyx_v_width = ((double)8.5);
  double __pyx_v_height = ((double)11.0);

  /* "pywrapfst.pyx":1849
 *                   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":1850
 *                   double height=11,
 *                   bool portrait=False,
 *                   bool vertical=False,             # <<<<<<<<<<<<<<
 *                   double ranksep=0.4,
 *                   double nodesep=0.25,
*/
  bool __pyx_v_vertical = ((bool)0);
  double __pyx_v_ranksep = ((double)0.4);
  double __pyx_v_nodesep = ((double)0.25);
  int32_t __pyx_v_fontsize = ((int32_t)14);
  int32_t __pyx_v_precision = ((int32_t)5);
  PyObject *__pyx_v_float_format = ((PyObject *)__pyx_mstate_global->__pyx_n_u_g);

  /* "pywrapfst.pyx":1856
 *                   int32_t precision=5,
 *                   float_format="g",
 *                   bool show_weight_one=False,             # <<<<<<<<<<<<<<
 *                   format="dot") except *:
 *     """
*/
  bool __pyx_v_show_weight_one = ((bool)0);
  PyObject *__pyx_v_format = ((PyObject *)__pyx_mstate_global->__pyx_n_u_dot);
  std::string __pyx_v__source;
  std::unique_ptr<std::ostream>  __pyx_v__fstrm;
  fst::SymbolTable const *__pyx_v__isymbols;
  fst::SymbolTable const *__pyx_v__osymbols;
  fst::SymbolTable const *__pyx_v__ssymbols;
  std::string __pyx_v__title;
  std::string __pyx_v__float_format;
  std::string __pyx_v__format;
  __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;
  size_t __pyx_t_15;
  std::string __pyx_t_16;
  int __pyx_t_17;
  fst::SymbolTable const *__pyx_t_18;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_isymbols = __pyx_optional_args->isymbols;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_osymbols = __pyx_optional_args->osymbols;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ssymbols = __pyx_optional_args->ssymbols;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_acceptor = __pyx_optional_args->acceptor;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_title = __pyx_optional_args->title;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_width = __pyx_optional_args->width;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_height = __pyx_optional_args->height;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_portrait = __pyx_optional_args->portrait;
                    if (__pyx_optional_args->__pyx_n > 8) {
                      __pyx_v_vertical = __pyx_optional_args->vertical;
                      if (__pyx_optional_args->__pyx_n > 9) {
                        __pyx_v_ranksep = __pyx_optional_args->ranksep;
                        if (__pyx_optional_args->__pyx_n > 10) {
                          __pyx_v_nodesep = __pyx_optional_args->nodesep;
                          if (__pyx_optional_args->__pyx_n > 11) {
                            __pyx_v_fontsize = __pyx_optional_args->fontsize;
                            if (__pyx_optional_args->__pyx_n > 12) {
                              __pyx_v_precision = __pyx_optional_args->precision;
                              if (__pyx_optional_args->__pyx_n > 13) {
                                __pyx_v_float_format = __pyx_optional_args->float_format;
                                if (__pyx_optional_args->__pyx_n > 14) {
                                  __pyx_v_show_weight_one = __pyx_optional_args->show_weight_one;
                                  if (__pyx_optional_args->__pyx_n > 15) {
                                    __pyx_v_format = __pyx_optional_args->format;
                                  }
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":1840
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
*/
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_draw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_17draw)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyFloat_FromDouble(__pyx_v_width); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_height); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_portrait); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = __Pyx_PyBool_FromLong(__pyx_v_vertical); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyFloat_FromDouble(__pyx_v_ranksep); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = PyFloat_FromDouble(__pyx_v_nodesep); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_PyLong_From_int32_t(__pyx_v_fontsize); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyLong_From_int32_t(__pyx_v_precision); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_14 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __pyx_t_15 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_15 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[18] = {__pyx_t_3, __pyx_v_source, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_5, __pyx_v_title, __pyx_t_6, __pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_v_float_format, __pyx_t_14, __pyx_v_format};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_15, (18-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 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;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1891
 *       format: One of: 'dot' or 'd2'.
 *     """
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[ostream] _fstrm
 *     _fstrm.reset(new ofstream(_source))
*/
  __pyx_t_16 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1891, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_16);

  /* "pywrapfst.pyx":1893
 *     cdef string _source = path_tostring(source)
 *     cdef unique_ptr[ostream] _fstrm
 *     _fstrm.reset(new ofstream(_source))             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:
*/
  __pyx_v__fstrm.reset(new std::ofstream(__pyx_v__source));

  /* "pywrapfst.pyx":1894
 *     cdef unique_ptr[ostream] _fstrm
 *     _fstrm.reset(new ofstream(_source))
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()             # <<<<<<<<<<<<<<
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1894, __pyx_L1_error)
  }
  __pyx_v__isymbols = __pyx_v_self->_fst.get()->InputSymbols();

  /* "pywrapfst.pyx":1895
 *     _fstrm.reset(new ofstream(_source))
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
*/
  __pyx_t_17 = (((PyObject *)__pyx_v_isymbols) != Py_None);
  if (__pyx_t_17) {

    /* "pywrapfst.pyx":1896
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1896, __pyx_L1_error)
    }
    __pyx_t_18 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1896, __pyx_L1_error)
    __pyx_v__isymbols = __pyx_t_18;

    /* "pywrapfst.pyx":1895
 *     _fstrm.reset(new ofstream(_source))
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
*/
  }

  /* "pywrapfst.pyx":1897
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()             # <<<<<<<<<<<<<<
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1897, __pyx_L1_error)
  }
  __pyx_v__osymbols = __pyx_v_self->_fst.get()->OutputSymbols();

  /* "pywrapfst.pyx":1898
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
*/
  __pyx_t_17 = (((PyObject *)__pyx_v_osymbols) != Py_None);
  if (__pyx_t_17) {

    /* "pywrapfst.pyx":1899
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1899, __pyx_L1_error)
    }
    __pyx_t_18 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1899, __pyx_L1_error)
    __pyx_v__osymbols = __pyx_t_18;

    /* "pywrapfst.pyx":1898
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
*/
  }

  /* "pywrapfst.pyx":1900
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
*/
  __pyx_v__ssymbols = NULL;

  /* "pywrapfst.pyx":1901
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef string _title = tostring(title)
*/
  __pyx_t_17 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  if (__pyx_t_17) {

    /* "pywrapfst.pyx":1902
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef string _title = tostring(title)
 *     cdef string _float_format = tostring(float_format)
*/
    if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 1902, __pyx_L1_error)
    }
    __pyx_t_18 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1902, __pyx_L1_error)
    __pyx_v__ssymbols = __pyx_t_18;

    /* "pywrapfst.pyx":1901
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef string _title = tostring(title)
*/
  }

  /* "pywrapfst.pyx":1903
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef string _title = tostring(title)             # <<<<<<<<<<<<<<
 *     cdef string _float_format = tostring(float_format)
 *     cdef string _format = tostring(format)
*/
  __pyx_t_16 = __pyx_f_9pywrapfst_tostring(__pyx_v_title); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1903, __pyx_L1_error)
  __pyx_v__title = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_16);

  /* "pywrapfst.pyx":1904
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef string _title = tostring(title)
 *     cdef string _float_format = tostring(float_format)             # <<<<<<<<<<<<<<
 *     cdef string _format = tostring(format)
 *     with nogil:
*/
  __pyx_t_16 = __pyx_f_9pywrapfst_tostring(__pyx_v_float_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1904, __pyx_L1_error)
  __pyx_v__float_format = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_16);

  /* "pywrapfst.pyx":1905
 *     cdef string _title = tostring(title)
 *     cdef string _float_format = tostring(float_format)
 *     cdef string _format = tostring(format)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Draw(deref(self._fst),
*/
  __pyx_t_16 = __pyx_f_9pywrapfst_tostring(__pyx_v_format); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1905, __pyx_L1_error)
  __pyx_v__format = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_16);

  /* "pywrapfst.pyx":1906
 *     cdef string _float_format = tostring(float_format)
 *     cdef string _format = tostring(format)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Draw(deref(self._fst),
 *                _isymbols,
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1907
 *     cdef string _format = tostring(format)
 *     with nogil:
 *       fst.Draw(deref(self._fst),             # <<<<<<<<<<<<<<
 *                _isymbols,
 *                _osymbols,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1907, __pyx_L7_error)
        }

        /* "pywrapfst.pyx":1925
 *                _format,
 *                deref(_fstrm),
 *                _source)             # <<<<<<<<<<<<<<
 * 
 *   cpdef Weight final(self, int64_t state):
*/
        fst::script::Draw((*__pyx_v_self->_fst), __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, __pyx_v__format, (*__pyx_v__fstrm), __pyx_v__source);
      }

      /* "pywrapfst.pyx":1906
 *     cdef string _float_format = tostring(float_format)
 *     cdef string _format = tostring(format)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Draw(deref(self._fst),
 *                _isymbols,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pywrapfst.pyx":1840
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("pywrapfst.Fst.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_17draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_16draw, "\n    draw(self, source, isymbols=None, osymbols=None, ssymbols=None,\n         acceptor=False, title=\"\", width=8.5, height=11, portrait=False,\n         vertical=False, ranksep=0.4, nodesep=0.25, fontsize=14,\n         precision=5, float_format=\"g\", show_weight_one=False,\n         format=\"dot\"):\n\n    Writes out the FST in Graphviz or D2 text format.\n\n    This method writes out the FST in the dot graph description language. The\n    graph can be rendered using the `dot` executable provided by Graphviz.\n\n    Args:\n      source: The string location of the output dot/Graphviz file.\n      isymbols: An optional symbol table used to label input symbols.\n      osymbols: An optional symbol table used to label output symbols.\n      ssymbols: An optional symbol table used to label states.\n      acceptor: Should the figure be rendered in acceptor format if possible?\n      title: An optional string indicating the figure title.\n      width: The figure width, in inches.\n      height: The figure height, in inches.\n      portrait: Should the figure be rendered in portrait rather than\n          landscape?\n      vertical: Should the figure be rendered bottom-to-top rather than\n          left-to-right?\n      ranksep: The minimum separation separation between ranks, in inches.\n      nodesep: The minimum separation between nodes, in inches.\n      fontsize: Font size, in points.\n      precision: Numeric precision for floats, in number of chars.\n      float_format: One of: 'e', 'f' or 'g'.\n      show_weight_one: Should weights equivalent to semiring One be printed?\n      format: One of: 'dot' or 'd2'.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_17draw = {"draw", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_17draw, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_16draw};
static PyObject *__pyx_pw_9pywrapfst_3Fst_17draw(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = 0;
  bool __pyx_v_acceptor;
  PyObject *__pyx_v_title = 0;
  double __pyx_v_width;
  double __pyx_v_height;
  bool __pyx_v_portrait;
  bool __pyx_v_vertical;
  double __pyx_v_ranksep;
  double __pyx_v_nodesep;
  int32_t __pyx_v_fontsize;
  int32_t __pyx_v_precision;
  PyObject *__pyx_v_float_format = 0;
  bool __pyx_v_show_weight_one;
  PyObject *__pyx_v_format = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[17] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,&__pyx_mstate_global->__pyx_n_u_isymbols,&__pyx_mstate_global->__pyx_n_u_osymbols,&__pyx_mstate_global->__pyx_n_u_ssymbols,&__pyx_mstate_global->__pyx_n_u_acceptor,&__pyx_mstate_global->__pyx_n_u_title,&__pyx_mstate_global->__pyx_n_u_width,&__pyx_mstate_global->__pyx_n_u_height,&__pyx_mstate_global->__pyx_n_u_portrait,&__pyx_mstate_global->__pyx_n_u_vertical,&__pyx_mstate_global->__pyx_n_u_ranksep,&__pyx_mstate_global->__pyx_n_u_nodesep,&__pyx_mstate_global->__pyx_n_u_fontsize,&__pyx_mstate_global->__pyx_n_u_precision,&__pyx_mstate_global->__pyx_n_u_float_format,&__pyx_mstate_global->__pyx_n_u_show_weight_one,&__pyx_mstate_global->__pyx_n_u_format,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1840, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "draw", 0) < 0) __PYX_ERR(0, 1840, __pyx_L3_error)

      /* "pywrapfst.pyx":1842
 *   cpdef void draw(self,
 *                   source,
 *                   SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":1843
 *                   source,
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":1844
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *                   bool acceptor=False,
 *                   title="",
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));
      if (!values[14]) values[14] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_g));
      if (!values[16]) values[16] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_dot));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 17, i); __PYX_ERR(0, 1840, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case 17:
        values[16] = __Pyx_ArgRef_FASTCALL(__pyx_args, 16);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[16])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 16:
        values[15] = __Pyx_ArgRef_FASTCALL(__pyx_args, 15);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[15])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 15:
        values[14] = __Pyx_ArgRef_FASTCALL(__pyx_args, 14);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[14])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 14:
        values[13] = __Pyx_ArgRef_FASTCALL(__pyx_args, 13);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[13])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 13:
        values[12] = __Pyx_ArgRef_FASTCALL(__pyx_args, 12);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[12])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 12:
        values[11] = __Pyx_ArgRef_FASTCALL(__pyx_args, 11);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[11])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 11:
        values[10] = __Pyx_ArgRef_FASTCALL(__pyx_args, 10);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[10])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case 10:
        values[9] = __Pyx_ArgRef_FASTCALL(__pyx_args, 9);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[9])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  9:
        values[8] = __Pyx_ArgRef_FASTCALL(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 1840, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1840, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pywrapfst.pyx":1842
 *   cpdef void draw(self,
 *                   source,
 *                   SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":1843
 *                   source,
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,             # <<<<<<<<<<<<<<
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":1844
 *                   SymbolTableView isymbols=None,
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *                   bool acceptor=False,
 *                   title="",
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));
      if (!values[14]) values[14] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_g));
      if (!values[16]) values[16] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_dot));
    }
    __pyx_v_source = values[0];
    __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[1]);
    __pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[2]);
    __pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[3]);
    if (values[4]) {
      __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1845, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1845
 *                   SymbolTableView osymbols=None,
 *                   SymbolTableView ssymbols=None,
 *                   bool acceptor=False,             # <<<<<<<<<<<<<<
 *                   title="",
 *                   double width=8.5,
*/
      __pyx_v_acceptor = ((bool)0);
    }
    __pyx_v_title = values[5];
    if (values[6]) {
      __pyx_v_width = __Pyx_PyFloat_AsDouble(values[6]); if (unlikely((__pyx_v_width == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1847, __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, 1848, __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, 1849, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1849
 *                   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, 1850, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1850
 *                   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, 1851, __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, 1852, __pyx_L3_error)
    } else {
      __pyx_v_nodesep = ((double)0.25);
    }
    if (values[12]) {
      __pyx_v_fontsize = __Pyx_PyLong_As_int32_t(values[12]); if (unlikely((__pyx_v_fontsize == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1853, __pyx_L3_error)
    } else {
      __pyx_v_fontsize = ((int32_t)14);
    }
    if (values[13]) {
      __pyx_v_precision = __Pyx_PyLong_As_int32_t(values[13]); if (unlikely((__pyx_v_precision == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1854, __pyx_L3_error)
    } else {
      __pyx_v_precision = ((int32_t)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, 1856, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":1856
 *                   int32_t precision=5,
 *                   float_format="g",
 *                   bool show_weight_one=False,             # <<<<<<<<<<<<<<
 *                   format="dot") except *:
 *     """
*/
      __pyx_v_show_weight_one = ((bool)0);
    }
    __pyx_v_format = values[16];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 17, __pyx_nargs); __PYX_ERR(0, 1840, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "isymbols", 0))) __PYX_ERR(0, 1842, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "osymbols", 0))) __PYX_ERR(0, 1843, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "ssymbols", 0))) __PYX_ERR(0, 1844, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_16draw(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_source, __pyx_v_isymbols, __pyx_v_osymbols, __pyx_v_ssymbols, __pyx_v_acceptor, __pyx_v_title, __pyx_v_width, __pyx_v_height, __pyx_v_portrait, __pyx_v_vertical, __pyx_v_ranksep, __pyx_v_nodesep, __pyx_v_fontsize, __pyx_v_precision, __pyx_v_float_format, __pyx_v_show_weight_one, __pyx_v_format);

  /* "pywrapfst.pyx":1840
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_3Fst_16draw(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, PyObject *__pyx_v_title, double __pyx_v_width, double __pyx_v_height, bool __pyx_v_portrait, bool __pyx_v_vertical, double __pyx_v_ranksep, double __pyx_v_nodesep, int32_t __pyx_v_fontsize, int32_t __pyx_v_precision, PyObject *__pyx_v_float_format, bool __pyx_v_show_weight_one, PyObject *__pyx_v_format) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_3Fst_draw __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("draw", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 16;
  __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_t_1.format = __pyx_v_format;
  __pyx_vtabptr_9pywrapfst_Fst->draw(__pyx_v_self, __pyx_v_source, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1840, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __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":1927
 *                _source)
 * 
 *   cpdef Weight final(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     final(self, state)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_19final(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_Weight *__pyx_f_9pywrapfst_3Fst_final(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __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;
  size_t __pyx_t_6;
  bool __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_final); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_19final)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1927, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1927, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight))))) __PYX_ERR(0, 1927, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1942
 *       FstIndexError: State index out of range.
 *     """
 *     cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     if not _weight.member():
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1942, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":1943
 *     """
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))             # <<<<<<<<<<<<<<
 *     if not _weight.member():
 *       raise FstIndexError("State index out of range")
*/
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_weight");
    __PYX_ERR(0, 1943, __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, 1943, __pyx_L1_error)
  }
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(__pyx_v_self->_fst.get()->Final(__pyx_v_state)));

  /* "pywrapfst.pyx":1944
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     if not _weight.member():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _weight
*/
  if (unlikely(((PyObject *)__pyx_v__weight) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "member");
    __PYX_ERR(0, 1944, __pyx_L1_error)
  }
  __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_Weight *)__pyx_v__weight->__pyx_vtab)->member(__pyx_v__weight, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1944, __pyx_L1_error)
  __pyx_t_8 = (!(__pyx_t_7 != 0));
  if (unlikely(__pyx_t_8)) {

    /* "pywrapfst.pyx":1945
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     if not _weight.member():
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return _weight
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1945, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1945, __pyx_L1_error)

    /* "pywrapfst.pyx":1944
 *     cdef Weight _weight = Weight.__new__(Weight)
 *     _weight._weight.reset(new fst.WeightClass(self._fst.get().Final(state)))
 *     if not _weight.member():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _weight
*/
  }

  /* "pywrapfst.pyx":1946
 *     if not _weight.member():
 *       raise FstIndexError("State index out of range")
 *     return _weight             # <<<<<<<<<<<<<<
 * 
 *   cpdef string fst_type(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v__weight);
  __pyx_r = __pyx_v__weight;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1927
 *                _source)
 * 
 *   cpdef Weight final(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     final(self, state)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("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_3Fst_19final(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_18final, "\n    final(self, state)\n\n    Returns the final weight of a state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      The final Weight of that state.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_19final = {"final", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_19final, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_18final};
static PyObject *__pyx_pw_9pywrapfst_3Fst_19final(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("final (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1927, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1927, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "final", 0) < 0) __PYX_ERR(0, 1927, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("final", 1, 1, 1, i); __PYX_ERR(0, 1927, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1927, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1927, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("final", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1927, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_3Fst_18final(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_18final(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("final", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_final(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1927, __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":1948
 *     return _weight
 * 
 *   cpdef string fst_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     fst_type(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_21fst_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static std::string __pyx_f_9pywrapfst_3Fst_fst_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  std::string __pyx_v__string;
  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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fst_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_fst_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1948, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_21fst_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1955
 *     """
 *     cdef string _string
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _string = self._fst.get().FstType()
 *     return _string
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1956
 *     cdef string _string
 *     with nogil:
 *       _string = self._fst.get().FstType()             # <<<<<<<<<<<<<<
 *     return _string
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1956, __pyx_L4_error)
        }
        __pyx_v__string = __pyx_v_self->_fst.get()->FstType();
      }

      /* "pywrapfst.pyx":1955
 *     """
 *     cdef string _string
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _string = self._fst.get().FstType()
 *     return _string
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1957
 *     with nogil:
 *       _string = self._fst.get().FstType()
 *     return _string             # <<<<<<<<<<<<<<
 * 
 *   cpdef _FstSymbolTableView input_symbols(self):
*/
  __pyx_r = __pyx_v__string;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1948
 *     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_AddTraceback("pywrapfst.Fst.fst_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_21fst_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_20fst_type, "\n    fst_type(self)\n\n    Returns a string indicating the FST type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_21fst_type = {"fst_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_21fst_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_20fst_type};
static PyObject *__pyx_pw_9pywrapfst_3Fst_21fst_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fst_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("fst_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("fst_type", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_20fst_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_20fst_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fst_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_fst_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1948, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1948, __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.fst_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":1959
 *     return _string
 * 
 *   cpdef _FstSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_23input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst_3Fst_input_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("input_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_input_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_23input_symbols)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1959, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst__FstSymbolTableView))))) __PYX_ERR(0, 1959, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1965
 *     Returns the FST's input symbol table, or None if none is present.
 *     """
 *     if self._fst.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1965, __pyx_L1_error)
  }
  __pyx_t_6 = (__pyx_v_self->_fst.get()->InputSymbols() == NULL);
  if (__pyx_t_6) {

    /* "pywrapfst.pyx":1966
 *     """
 *     if self._fst.get().InputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 * 
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":1965
 *     Returns the FST's input symbol table, or None if none is present.
 *     """
 *     if self._fst.get().InputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
*/
  }

  /* "pywrapfst.pyx":1967
 *     if self._fst.get().InputSymbols() == NULL:
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=True)             # <<<<<<<<<<<<<<
 * 
 *   def num_states_if_known(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, 1967, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTableView(__pyx_v_self->_fst, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1959
 *     return _string
 * 
 *   cpdef _FstSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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_3Fst_23input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_22input_symbols, "\n    input_symbols(self)\n\n    Returns the FST's input symbol table, or None if none is present.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_23input_symbols = {"input_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_23input_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_22input_symbols};
static PyObject *__pyx_pw_9pywrapfst_3Fst_23input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("input_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("input_symbols", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("input_symbols", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_22input_symbols(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_22input_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("input_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_input_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __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":1969
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 * 
 *   def num_states_if_known(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_states_if_known(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_25num_states_if_known(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_24num_states_if_known, "\n    num_states_if_known(self)\n\n    Returns the number of states if known, or None otherwise.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_25num_states_if_known = {"num_states_if_known", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_25num_states_if_known, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_24num_states_if_known};
static PyObject *__pyx_pw_9pywrapfst_3Fst_25num_states_if_known(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_states_if_known (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_states_if_known", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_states_if_known", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_24num_states_if_known(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_24num_states_if_known(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  std::optional<int64_t>  __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_FakeReference<int64_t> __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_states_if_known", 0);

  /* "pywrapfst.pyx":1975
 *     Returns the number of states if known, or None otherwise.
 *     """
 *     cdef optional[int64_t] result = self._fst.get().NumStatesIfKnown()             # <<<<<<<<<<<<<<
 *     return result.value() if result.has_value() else None
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 1975, __pyx_L1_error)
  }
  __pyx_v_result = __pyx_v_self->_fst.get()->NumStatesIfKnown();

  /* "pywrapfst.pyx":1976
 *     """
 *     cdef optional[int64_t] result = self._fst.get().NumStatesIfKnown()
 *     return result.value() if result.has_value() else None             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t num_arcs(self, int64_t state) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = (__pyx_v_result.has_value() != 0);
  if (__pyx_t_2) {
    try {
      __pyx_t_3 = __pyx_v_result.value();
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 1976, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __Pyx_INCREF(Py_None);
    __pyx_t_1 = Py_None;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1969
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 * 
 *   def num_states_if_known(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_states_if_known(self)
*/

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

/* "pywrapfst.pyx":1978
 *     return result.value() if result.has_value() else None
 * 
 *   cpdef size_t num_arcs(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_arcs(self, state)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_27num_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch) {
  size_t __pyx_v__size;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_arcs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1978, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_27num_arcs)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1978, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1978, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":1994
 *     """
 *     cdef size_t _size
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _size = self._fst.get().NumArcs(state)
 *     if _size == numeric_limits[size_t].max():
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":1995
 *     cdef size_t _size
 *     with nogil:
 *       _size = self._fst.get().NumArcs(state)             # <<<<<<<<<<<<<<
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 1995, __pyx_L4_error)
        }
        __pyx_v__size = __pyx_v_self->_fst.get()->NumArcs(__pyx_v_state);
      }

      /* "pywrapfst.pyx":1994
 *     """
 *     cdef size_t _size
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _size = self._fst.get().NumArcs(state)
 *     if _size == numeric_limits[size_t].max():
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":1996
 *     with nogil:
 *       _size = self._fst.get().NumArcs(state)
 *     if _size == numeric_limits[size_t].max():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _size
*/
  __pyx_t_7 = (__pyx_v__size == std::numeric_limits<size_t> ::max());
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":1997
 *       _size = self._fst.get().NumArcs(state)
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return _size
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 1997, __pyx_L1_error)

    /* "pywrapfst.pyx":1996
 *     with nogil:
 *       _size = self._fst.get().NumArcs(state)
 *     if _size == numeric_limits[size_t].max():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _size
*/
  }

  /* "pywrapfst.pyx":1998
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")
 *     return _size             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t num_input_epsilons(self, int64_t state) except *:
*/
  __pyx_r = __pyx_v__size;
  goto __pyx_L0;

  /* "pywrapfst.pyx":1978
 *     return result.value() if result.has_value() else None
 * 
 *   cpdef size_t num_arcs(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_arcs(self, state)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("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_3Fst_27num_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_26num_arcs, "\n    num_arcs(self, state)\n\n    Returns the number of arcs leaving a state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      The number of arcs leaving that state.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_27num_arcs = {"num_arcs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_27num_arcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_26num_arcs};
static PyObject *__pyx_pw_9pywrapfst_3Fst_27num_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_arcs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 1978, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1978, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "num_arcs", 0) < 0) __PYX_ERR(0, 1978, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("num_arcs", 1, 1, 1, i); __PYX_ERR(0, 1978, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 1978, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1978, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("num_arcs", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1978, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_3Fst_26num_arcs(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_26num_arcs(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_arcs(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1978, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __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":2000
 *     return _size
 * 
 *   cpdef size_t num_input_epsilons(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_input_epsilons(self, state)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_29num_input_epsilons(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_input_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch) {
  size_t __pyx_v__size;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_input_epsilons", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_input_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2000, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_29num_input_epsilons)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2000, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2000, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2000, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2016
 *     """
 *     cdef size_t _size
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _size = self._fst.get().NumInputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2017
 *     cdef size_t _size
 *     with nogil:
 *       _size = self._fst.get().NumInputEpsilons(state)             # <<<<<<<<<<<<<<
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2017, __pyx_L4_error)
        }
        __pyx_v__size = __pyx_v_self->_fst.get()->NumInputEpsilons(__pyx_v_state);
      }

      /* "pywrapfst.pyx":2016
 *     """
 *     cdef size_t _size
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _size = self._fst.get().NumInputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2018
 *     with nogil:
 *       _size = self._fst.get().NumInputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _size
*/
  __pyx_t_7 = (__pyx_v__size == std::numeric_limits<size_t> ::max());
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":2019
 *       _size = self._fst.get().NumInputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return _size
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2019, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2019, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2019, __pyx_L1_error)

    /* "pywrapfst.pyx":2018
 *     with nogil:
 *       _size = self._fst.get().NumInputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _size
*/
  }

  /* "pywrapfst.pyx":2020
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")
 *     return _size             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t num_output_epsilons(self, int64_t state) except *:
*/
  __pyx_r = __pyx_v__size;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2000
 *     return _size
 * 
 *   cpdef size_t num_input_epsilons(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_input_epsilons(self, state)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("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_3Fst_29num_input_epsilons(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_28num_input_epsilons, "\n    num_input_epsilons(self, state)\n\n    Returns the number of arcs with epsilon input labels leaving a state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      The number of epsilon-input-labeled arcs leaving that state.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_29num_input_epsilons = {"num_input_epsilons", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_29num_input_epsilons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_28num_input_epsilons};
static PyObject *__pyx_pw_9pywrapfst_3Fst_29num_input_epsilons(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_input_epsilons (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2000, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2000, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "num_input_epsilons", 0) < 0) __PYX_ERR(0, 2000, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("num_input_epsilons", 1, 1, 1, i); __PYX_ERR(0, 2000, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2000, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2000, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("num_input_epsilons", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2000, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_3Fst_28num_input_epsilons(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_28num_input_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_input_epsilons", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_input_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2000, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2000, __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":2022
 *     return _size
 * 
 *   cpdef size_t num_output_epsilons(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_output_epsilons(self, state)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_31num_output_epsilons(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_9pywrapfst_3Fst_num_output_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state, int __pyx_skip_dispatch) {
  size_t __pyx_v__size;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_output_epsilons", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_output_epsilons); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2022, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_31num_output_epsilons)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2022, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2022, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2038
 *     """
 *     cdef size_t _size
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _size = self._fst.get().NumOutputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2039
 *     cdef size_t _size
 *     with nogil:
 *       _size = self._fst.get().NumOutputEpsilons(state)             # <<<<<<<<<<<<<<
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2039, __pyx_L4_error)
        }
        __pyx_v__size = __pyx_v_self->_fst.get()->NumOutputEpsilons(__pyx_v_state);
      }

      /* "pywrapfst.pyx":2038
 *     """
 *     cdef size_t _size
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _size = self._fst.get().NumOutputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2040
 *     with nogil:
 *       _size = self._fst.get().NumOutputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _size
*/
  __pyx_t_7 = (__pyx_v__size == std::numeric_limits<size_t> ::max());
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":2041
 *       _size = self._fst.get().NumOutputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     return _size
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2041, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2041, __pyx_L1_error)

    /* "pywrapfst.pyx":2040
 *     with nogil:
 *       _size = self._fst.get().NumOutputEpsilons(state)
 *     if _size == numeric_limits[size_t].max():             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     return _size
*/
  }

  /* "pywrapfst.pyx":2042
 *     if _size == numeric_limits[size_t].max():
 *       raise FstIndexError("State index out of range")
 *     return _size             # <<<<<<<<<<<<<<
 * 
 *   cpdef _FstSymbolTableView output_symbols(self):
*/
  __pyx_r = __pyx_v__size;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2022
 *     return _size
 * 
 *   cpdef size_t num_output_epsilons(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_output_epsilons(self, state)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("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_3Fst_31num_output_epsilons(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_30num_output_epsilons, "\n    num_output_epsilons(self, state)\n\n    Returns the number of arcs with epsilon output labels leaving a state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      The number of epsilon-output-labeled arcs leaving that state.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_31num_output_epsilons = {"num_output_epsilons", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_31num_output_epsilons, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_30num_output_epsilons};
static PyObject *__pyx_pw_9pywrapfst_3Fst_31num_output_epsilons(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_output_epsilons (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2022, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2022, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "num_output_epsilons", 0) < 0) __PYX_ERR(0, 2022, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("num_output_epsilons", 1, 1, 1, i); __PYX_ERR(0, 2022, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2022, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("num_output_epsilons", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2022, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_3Fst_30num_output_epsilons(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_30num_output_epsilons(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int64_t __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_output_epsilons", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_num_output_epsilons(__pyx_v_self, __pyx_v_state, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2022, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2022, __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":2044
 *     return _size
 * 
 *   cpdef _FstSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_33output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_f_9pywrapfst_3Fst_output_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_9pywrapfst__FstSymbolTableView *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("output_symbols", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_output_symbols); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_33output_symbols)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2044, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst__FstSymbolTableView))))) __PYX_ERR(0, 2044, __pyx_L1_error)
        __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2050
 *     Returns the FST's output symbol table, or None if none is present.
 *     """
 *     if self._fst.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2050, __pyx_L1_error)
  }
  __pyx_t_6 = (__pyx_v_self->_fst.get()->OutputSymbols() == NULL);
  if (__pyx_t_6) {

    /* "pywrapfst.pyx":2051
 *     """
 *     if self._fst.get().OutputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)Py_None); __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":2050
 *     Returns the FST's output symbol table, or None if none is present.
 *     """
 *     if self._fst.get().OutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
*/
  }

  /* "pywrapfst.pyx":2052
 *     if self._fst.get().OutputSymbols() == NULL:
 *       return
 *     return _init_FstSymbolTableView(self._fst, input_side=False)             # <<<<<<<<<<<<<<
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2052, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_FstSymbolTableView(__pyx_v_self->_fst, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2052, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2044
 *     return _size
 * 
 *   cpdef _FstSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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_3Fst_33output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_32output_symbols, "\n    output_symbols(self)\n\n    Returns the FST's output symbol table, or None if none is present.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_33output_symbols = {"output_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_33output_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_32output_symbols};
static PyObject *__pyx_pw_9pywrapfst_3Fst_33output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("output_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("output_symbols", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("output_symbols", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_32output_symbols(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_32output_symbols(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("output_symbols", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_output_symbols(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2044, __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":2054
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_35print(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static std::string __pyx_f_9pywrapfst_3Fst_print(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_print *__pyx_optional_args) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);

  /* "pywrapfst.pyx":2055
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *       bool acceptor=False, bool show_weight_one=False,
 *       missing_sym="") except *:
*/
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);

  /* "pywrapfst.pyx":2056
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,             # <<<<<<<<<<<<<<
 *       missing_sym="") except *:
 *     """
*/
  bool __pyx_v_acceptor = ((bool)0);
  bool __pyx_v_show_weight_one = ((bool)0);
  PyObject *__pyx_v_missing_sym = ((PyObject *)__pyx_mstate_global->__pyx_kp_u__6);
  fst::SymbolTable const *__pyx_v__isymbols;
  fst::SymbolTable const *__pyx_v__osymbols;
  fst::SymbolTable const *__pyx_v__ssymbols;
  std::stringstream __pyx_v__sstrm;
  std::string __pyx_v__missing_sym;
  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;
  size_t __pyx_t_7;
  std::string __pyx_t_8;
  int __pyx_t_9;
  fst::SymbolTable const *__pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_isymbols = __pyx_optional_args->isymbols;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_osymbols = __pyx_optional_args->osymbols;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_ssymbols = __pyx_optional_args->ssymbols;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_acceptor = __pyx_optional_args->acceptor;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_show_weight_one = __pyx_optional_args->show_weight_one;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_missing_sym = __pyx_optional_args->missing_sym;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":2054
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
*/
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_print); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2054, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_35print)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_acceptor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_show_weight_one); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_7 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[7] = {__pyx_t_3, ((PyObject *)__pyx_v_isymbols), ((PyObject *)__pyx_v_osymbols), ((PyObject *)__pyx_v_ssymbols), __pyx_t_5, __pyx_t_6, __pyx_v_missing_sym};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (7-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2054, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_8 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2054, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_8;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2080
 *     """
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()             # <<<<<<<<<<<<<<
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2080, __pyx_L1_error)
  }
  __pyx_v__isymbols = __pyx_v_self->_fst.get()->InputSymbols();

  /* "pywrapfst.pyx":2081
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
*/
  __pyx_t_9 = (((PyObject *)__pyx_v_isymbols) != Py_None);
  if (__pyx_t_9) {

    /* "pywrapfst.pyx":2082
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2082, __pyx_L1_error)
    }
    __pyx_t_10 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2082, __pyx_L1_error)
    __pyx_v__isymbols = __pyx_t_10;

    /* "pywrapfst.pyx":2081
 *     # Prints FST to stringstream, then returns resulting string.
 *     cdef const fst.SymbolTable *_isymbols = self._fst.get().InputSymbols()
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
*/
  }

  /* "pywrapfst.pyx":2083
 *     if isymbols is not None:
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()             # <<<<<<<<<<<<<<
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2083, __pyx_L1_error)
  }
  __pyx_v__osymbols = __pyx_v_self->_fst.get()->OutputSymbols();

  /* "pywrapfst.pyx":2084
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
*/
  __pyx_t_9 = (((PyObject *)__pyx_v_osymbols) != Py_None);
  if (__pyx_t_9) {

    /* "pywrapfst.pyx":2085
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2085, __pyx_L1_error)
    }
    __pyx_t_10 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2085, __pyx_L1_error)
    __pyx_v__osymbols = __pyx_t_10;

    /* "pywrapfst.pyx":2084
 *        _isymbols = isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_osymbols = self._fst.get().OutputSymbols()
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
*/
  }

  /* "pywrapfst.pyx":2086
 *     if osymbols is not None:
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
*/
  __pyx_v__ssymbols = NULL;

  /* "pywrapfst.pyx":2087
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef stringstream _sstrm
*/
  __pyx_t_9 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  if (__pyx_t_9) {

    /* "pywrapfst.pyx":2088
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:
 *       _ssymbols = ssymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef stringstream _sstrm
 *     cdef string _missing_sym = tostring(missing_sym)
*/
    if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2088, __pyx_L1_error)
    }
    __pyx_t_10 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_ssymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2088, __pyx_L1_error)
    __pyx_v__ssymbols = __pyx_t_10;

    /* "pywrapfst.pyx":2087
 *        _osymbols = osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef stringstream _sstrm
*/
  }

  /* "pywrapfst.pyx":2090
 *       _ssymbols = ssymbols._raw_ptr_or_raise()
 *     cdef stringstream _sstrm
 *     cdef string _missing_sym = tostring(missing_sym)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Print(deref(self._fst),
*/
  __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_missing_sym); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2090, __pyx_L1_error)
  __pyx_v__missing_sym = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

  /* "pywrapfst.pyx":2091
 *     cdef stringstream _sstrm
 *     cdef string _missing_sym = tostring(missing_sym)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Print(deref(self._fst),
 *                 _sstrm,
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2092
 *     cdef string _missing_sym = tostring(missing_sym)
 *     with nogil:
 *       fst.Print(deref(self._fst),             # <<<<<<<<<<<<<<
 *                 _sstrm,
 *                 b"<pywrapfst>",
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2092, __pyx_L7_error)
        }

        /* "pywrapfst.pyx":2100
 *                 acceptor,
 *                 show_weight_one,
 *                 _missing_sym)             # <<<<<<<<<<<<<<
 *     return _sstrm.str()
 * 
*/
        fst::script::Print((*__pyx_v_self->_fst), __pyx_v__sstrm, __pyx_k_pywrapfst, __pyx_v__isymbols, __pyx_v__osymbols, __pyx_v__ssymbols, __pyx_v_acceptor, __pyx_v_show_weight_one, __pyx_v__missing_sym);
      }

      /* "pywrapfst.pyx":2091
 *     cdef stringstream _sstrm
 *     cdef string _missing_sym = tostring(missing_sym)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Print(deref(self._fst),
 *                 _sstrm,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pywrapfst.pyx":2101
 *                 show_weight_one,
 *                 _missing_sym)
 *     return _sstrm.str()             # <<<<<<<<<<<<<<
 * 
 *   cdef uint64_t _properties(self, uint64_t mask, bool test):
*/
  __pyx_r = __pyx_v__sstrm.str();
  goto __pyx_L0;

  /* "pywrapfst.pyx":2054
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pywrapfst.Fst.print", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_35print(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_34print, "\n    print(self, isymbols=None, osymbols=None, ssymbols=None, acceptor=False,\n          show_weight_one=False, missing_sym=\"\")\n\n    Produces a human-readable string representation of the FST.\n\n    This method generates a human-readable string representation of the FST.\n    The caller may optionally specify SymbolTables used to label input labels,\n    output labels, or state labels, respectively.\n\n    Args:\n      isymbols: An optional symbol table used to label input symbols.\n      osymbols: An optional symbol table used to label output symbols.\n      ssymbols: An optional symbol table used to label states.\n      acceptor: Should the FST be rendered in acceptor format if possible?\n      show_weight_one: Should weights equivalent to semiring One be printed?\n      missing_symbol: The string to be printed when symbol table lookup fails.\n\n    Returns:\n      A formatted string representing the machine.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_35print = {"print", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_35print, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_34print};
static PyObject *__pyx_pw_9pywrapfst_3Fst_35print(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols = 0;
  bool __pyx_v_acceptor;
  bool __pyx_v_show_weight_one;
  PyObject *__pyx_v_missing_sym = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[6] = {0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("print (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_isymbols,&__pyx_mstate_global->__pyx_n_u_osymbols,&__pyx_mstate_global->__pyx_n_u_ssymbols,&__pyx_mstate_global->__pyx_n_u_acceptor,&__pyx_mstate_global->__pyx_n_u_show_weight_one,&__pyx_mstate_global->__pyx_n_u_missing_sym,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2054, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "print", 0) < 0) __PYX_ERR(0, 2054, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":2055
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *       bool acceptor=False, bool show_weight_one=False,
 *       missing_sym="") except *:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));
    } else {
      switch (__pyx_nargs) {
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2054, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pywrapfst.pyx":2054
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":2055
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,             # <<<<<<<<<<<<<<
 *       bool acceptor=False, bool show_weight_one=False,
 *       missing_sym="") except *:
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));
    }
    __pyx_v_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
    __pyx_v_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[1]);
    __pyx_v_ssymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[2]);
    if (values[3]) {
      __pyx_v_acceptor = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_acceptor == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2056, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2056
 *   cpdef string print(self, SymbolTableView isymbols=None,
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,             # <<<<<<<<<<<<<<
 *       missing_sym="") except *:
 *     """
*/
      __pyx_v_acceptor = ((bool)0);
    }
    if (values[4]) {
      __pyx_v_show_weight_one = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_show_weight_one == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2056, __pyx_L3_error)
    } else {
      __pyx_v_show_weight_one = ((bool)0);
    }
    __pyx_v_missing_sym = values[5];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("print", 0, 0, 6, __pyx_nargs); __PYX_ERR(0, 2054, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Fst.print", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "isymbols", 0))) __PYX_ERR(0, 2054, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "osymbols", 0))) __PYX_ERR(0, 2055, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "ssymbols", 0))) __PYX_ERR(0, 2055, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_34print(((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":2054
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_3Fst_34print(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_ssymbols, bool __pyx_v_acceptor, bool __pyx_v_show_weight_one, PyObject *__pyx_v_missing_sym) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  struct __pyx_opt_args_9pywrapfst_3Fst_print __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("print", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.isymbols = __pyx_v_isymbols;
  __pyx_t_2.osymbols = __pyx_v_osymbols;
  __pyx_t_2.ssymbols = __pyx_v_ssymbols;
  __pyx_t_2.acceptor = __pyx_v_acceptor;
  __pyx_t_2.show_weight_one = __pyx_v_show_weight_one;
  __pyx_t_2.missing_sym = __pyx_v_missing_sym;
  __pyx_t_1 = __pyx_vtabptr_9pywrapfst_Fst->print(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2054, __pyx_L1_error)
  __pyx_t_3 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2054, __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.print", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2103
 *     return _sstrm.str()
 * 
 *   cdef uint64_t _properties(self, uint64_t mask, bool test):             # <<<<<<<<<<<<<<
 *     cdef uint64_t _props
 *     with nogil:
*/

static uint64_t __pyx_f_9pywrapfst_3Fst__properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, uint64_t __pyx_v_mask, bool __pyx_v_test) {
  uint64_t __pyx_v__props;
  uint64_t __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":2105
 *   cdef uint64_t _properties(self, uint64_t mask, bool test):
 *     cdef uint64_t _props
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _props = self._fst.get().Properties(mask, test)
 *     return _props
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2106
 *     cdef uint64_t _props
 *     with nogil:
 *       _props = self._fst.get().Properties(mask, test)             # <<<<<<<<<<<<<<
 *     return _props
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2106, __pyx_L4_error)
        }
        __pyx_v__props = __pyx_v_self->_fst.get()->Properties(__pyx_v_mask, __pyx_v_test);
      }

      /* "pywrapfst.pyx":2105
 *   cdef uint64_t _properties(self, uint64_t mask, bool test):
 *     cdef uint64_t _props
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _props = self._fst.get().Properties(mask, test)
 *     return _props
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2107
 *     with nogil:
 *       _props = self._fst.get().Properties(mask, test)
 *     return _props             # <<<<<<<<<<<<<<
 * 
 *   def properties(self, mask, bool test):
*/
  __pyx_r = __pyx_v__props;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2103
 *     return _sstrm.str()
 * 
 *   cdef uint64_t _properties(self, uint64_t mask, bool test):             # <<<<<<<<<<<<<<
 *     cdef uint64_t _props
 *     with nogil:
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.Fst._properties", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "pywrapfst.pyx":2109
 *     return _props
 * 
 *   def properties(self, mask, bool test):             # <<<<<<<<<<<<<<
 *     """properties(self, mask)
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_37properties(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_36properties, "properties(self, mask)\n\n    Returns the mapper's properties.\n\n    Returns:\n      A bitmask.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_37properties = {"properties", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_37properties, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_36properties};
static PyObject *__pyx_pw_9pywrapfst_3Fst_37properties(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_mask = 0;
  bool __pyx_v_test;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("properties (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mask,&__pyx_mstate_global->__pyx_n_u_test,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2109, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2109, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "properties", 0) < 0) __PYX_ERR(0, 2109, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, i); __PYX_ERR(0, 2109, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2109, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2109, __pyx_L3_error)
    }
    __pyx_v_mask = values[0];
    __pyx_v_test = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_test == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2109, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("properties", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2109, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_3Fst_36properties(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_mask, __pyx_v_test);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_36properties(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_mask, bool __pyx_v_test) {
  uint64_t __pyx_v__mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint64_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("properties", 0);

  /* "pywrapfst.pyx":2117
 *       A bitmask.
 *     """
 *     cdef uint64_t _mask = mask.value             # <<<<<<<<<<<<<<
 *     return FstProperties(self._properties(_mask, test))
 * 
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__mask = __pyx_t_2;

  /* "pywrapfst.pyx":2118
 *     """
 *     cdef uint64_t _mask = mask.value
 *     return FstProperties(self._properties(_mask, test))             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstProperties); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_properties");
    __PYX_ERR(0, 2118, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_self->__pyx_vtab)->_properties(__pyx_v_self, __pyx_v__mask, __pyx_v_test); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2118, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyLong_From_uint64_t(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    assert(__pyx_t_3);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
    __pyx_t_6 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2109
 *     return _props
 * 
 *   def properties(self, mask, bool test):             # <<<<<<<<<<<<<<
 *     """properties(self, mask)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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":2120
 *     return FstProperties(self._properties(_mask, test))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_39read(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_38read, "\n    read(source)\n\n    Reads an FST from a file.\n\n    Args:\n      source: The string location of the input file.\n\n    Returns:\n      An FST object.\n\n    Raises:\n      FstIOError: Read failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_39read = {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_39read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_38read};
static PyObject *__pyx_pw_9pywrapfst_3Fst_39read(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2120, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2120, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read", 0) < 0) __PYX_ERR(0, 2120, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, i); __PYX_ERR(0, 2120, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2120, __pyx_L3_error)
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2120, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Fst.read", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_38read(((PyTypeObject*)__pyx_v_cls), __pyx_v_source);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_38read(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read", 0);

  /* "pywrapfst.pyx":2136
 *       FstIOError: Read failed.
 *     """
 *     return _read_Fst(source)             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_source, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2120
 *     return FstProperties(self._properties(_mask, test))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/

  /* 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":2138
 *     return _read_Fst(source)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_from_string(cls, state):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_41read_from_string(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_40read_from_string, "\n    read_from_string(state)\n\n    Reads an FST from a serialized string.\n\n    Args:\n      state: A string containing the serialized FST.\n\n    Returns:\n      An FST object.\n\n    Raises:\n      FstIOError: Read failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_41read_from_string = {"read_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_41read_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_40read_from_string};
static PyObject *__pyx_pw_9pywrapfst_3Fst_41read_from_string(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_from_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2138, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2138, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "read_from_string", 0) < 0) __PYX_ERR(0, 2138, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("read_from_string", 1, 1, 1, i); __PYX_ERR(0, 2138, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2138, __pyx_L3_error)
    }
    __pyx_v_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2138, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Fst.read_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_40read_from_string(((PyTypeObject*)__pyx_v_cls), __pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_40read_from_string(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_from_string", 0);

  /* "pywrapfst.pyx":2154
 *       FstIOError: Read failed.
 *     """
 *     return _read_Fst_from_string(state)             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64_t start(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2154, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1), 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2138
 *     return _read_Fst(source)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_from_string(cls, state):
 *     """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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":2156
 *     return _read_Fst_from_string(state)
 * 
 *   cpdef int64_t start(self):             # <<<<<<<<<<<<<<
 *     """
 *     start(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_43start(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int64_t __pyx_f_9pywrapfst_3Fst_start(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  int64_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;
  int64_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_43start)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2156, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2156, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2162
 *     Returns the start state.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._fst.get().Start()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2163
 *     """
 *     with nogil:
 *       return self._fst.get().Start()             # <<<<<<<<<<<<<<
 * 
 *   cpdef _StateIterator states(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2163, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_fst.get()->Start();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":2162
 *     Returns the start state.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._fst.get().Start()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":2156
 *     return _read_Fst_from_string(state)
 * 
 *   cpdef int64_t 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_AddTraceback("pywrapfst.Fst.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_43start(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_42start, "\n    start(self)\n\n    Returns the start state.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_43start = {"start", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_43start, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_42start};
static PyObject *__pyx_pw_9pywrapfst_3Fst_43start(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("start", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("start", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_42start(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_42start(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_start(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2156, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2156, __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.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2165
 *       return self._fst.get().Start()
 * 
 *   cpdef _StateIterator states(self):             # <<<<<<<<<<<<<<
 *     """
 *     states(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_45states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst__StateIterator *__pyx_f_9pywrapfst_3Fst_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("states", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2165, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_45states)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2165, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator))))) __PYX_ERR(0, 2165, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2174
 *       A _StateIterator object for the FST.
 *     """
 *     return _StateIterator(self)             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool verify(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator); 
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self)};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2174, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2165
 *       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_3Fst_45states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_44states, "\n    states(self)\n\n    Returns an iterator over all states in the FST.\n\n    Returns:\n      A _StateIterator object for the FST.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_45states = {"states", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_45states, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_44states};
static PyObject *__pyx_pw_9pywrapfst_3Fst_45states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("states (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("states", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("states", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_44states(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_44states(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("states", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Fst_states(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2165, __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":2176
 *     return _StateIterator(self)
 * 
 *   cpdef bool verify(self):             # <<<<<<<<<<<<<<
 *     """
 *     verify(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_47verify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static bool __pyx_f_9pywrapfst_3Fst_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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("verify", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_verify); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2176, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_47verify)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2176, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2185
 *       True if the contents are sane, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return fst.Verify(deref(self._fst))
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2186
 *     """
 *     with nogil:
 *       return fst.Verify(deref(self._fst))             # <<<<<<<<<<<<<<
 * 
 *   cpdef string weight_type(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2186, __pyx_L4_error)
        }
        __pyx_r = fst::script::Verify((*__pyx_v_self->_fst));
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":2185
 *       True if the contents are sane, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return fst.Verify(deref(self._fst))
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":2176
 *     return _StateIterator(self)
 * 
 *   cpdef bool verify(self):             # <<<<<<<<<<<<<<
 *     """
 *     verify(self)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_47verify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_46verify, "\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 PyMethodDef __pyx_mdef_9pywrapfst_3Fst_47verify = {"verify", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_47verify, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_46verify};
static PyObject *__pyx_pw_9pywrapfst_3Fst_47verify(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("verify (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("verify", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("verify", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_46verify(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_46verify(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("verify", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_verify(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2176, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2176, __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.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2188
 *       return fst.Verify(deref(self._fst))
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_49weight_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static std::string __pyx_f_9pywrapfst_3Fst_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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weight_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_weight_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2188, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_49weight_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2188, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2197
 *       A string representing the weight type.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._fst.get().WeightType()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2198
 *     """
 *     with nogil:
 *       return self._fst.get().WeightType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write(self, source) except *:
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2198, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_fst.get()->WeightType();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":2197
 *       A string representing the weight type.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._fst.get().WeightType()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":2188
 *       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_AddTraceback("pywrapfst.Fst.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_49weight_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_48weight_type, "\n    weight_type(self)\n\n    Returns the FST's weight type.\n\n    Returns:\n      A string representing the weight type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_49weight_type = {"weight_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_49weight_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_48weight_type};
static PyObject *__pyx_pw_9pywrapfst_3Fst_49weight_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("weight_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("weight_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("weight_type", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_48weight_type(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_48weight_type(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("weight_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_weight_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2188, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2188, __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.weight_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2200
 *       return self._fst.get().WeightType()
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, source)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_51write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_3Fst_write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source, int __pyx_skip_dispatch) {
  std::string __pyx_v__source;
  bool __pyx_v__result;
  __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;
  std::string __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_51write)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_source};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2200, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2214
 *       FstIOError: Write failed.
 *     """
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/
  __pyx_t_6 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2214, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pywrapfst.pyx":2216
 *     cdef string _source = path_tostring(source)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._fst.get().Write(_source)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2217
 *     cdef bool _result
 *     with nogil:
 *       _result = self._fst.get().Write(_source)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIOError(f"Write failed: {source!r}")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2217, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_self->_fst.get()->Write(__pyx_v__source);
      }

      /* "pywrapfst.pyx":2216
 *     cdef string _source = path_tostring(source)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._fst.get().Write(_source)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2218
 *     with nogil:
 *       _result = self._fst.get().Write(_source)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
*/
  __pyx_t_7 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":2219
 *       _result = self._fst.get().Write(_source)
 *     if not _result:
 *       raise FstIOError(f"Write failed: {source!r}")             # <<<<<<<<<<<<<<
 * 
 *   cpdef bytes write_to_string(self):
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Write_failed, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2219, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2219, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2219, __pyx_L1_error)

    /* "pywrapfst.pyx":2218
 *     with nogil:
 *       _result = self._fst.get().Write(_source)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
*/
  }

  /* "pywrapfst.pyx":2200
 *       return self._fst.get().WeightType()
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, source)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_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_3Fst_51write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_50write, "\n    write(self, source)\n\n    Serializes FST to a file.\n\n    This method writes the FST to a file in a binary format.\n\n    Args:\n      source: The string location of the output file.\n\n    Raises:\n      FstIOError: Write failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_51write = {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_51write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_50write};
static PyObject *__pyx_pw_9pywrapfst_3Fst_51write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2200, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2200, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "write", 0) < 0) __PYX_ERR(0, 2200, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, i); __PYX_ERR(0, 2200, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2200, __pyx_L3_error)
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2200, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Fst.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_50write(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self), __pyx_v_source);

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_50write(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_3Fst_write(__pyx_v_self, __pyx_v_source, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2200, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __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":2221
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *     """
 *     write_to_string(self)
*/

static PyObject *__pyx_pw_9pywrapfst_3Fst_53write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyObject *__pyx_f_9pywrapfst_3Fst_write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self, int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  bool __pyx_v__result;
  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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_write_to_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2221, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Fst_53write_to_string)) {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2221, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(PyBytes_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("bytes", __pyx_t_2))) __PYX_ERR(0, 2221, __pyx_L1_error)
        __pyx_r = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2235
 *     cdef stringstream _sstrm
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._fst.get().Write(_sstrm, b"<pywrapfst>")
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2236
 *     cdef bool _result
 *     with nogil:
 *       _result = self._fst.get().Write(_sstrm, b"<pywrapfst>")             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIOError("Write to string failed")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2236, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_self->_fst.get()->Write(__pyx_v__sstrm, __pyx_k_pywrapfst);
      }

      /* "pywrapfst.pyx":2235
 *     cdef stringstream _sstrm
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._fst.get().Write(_sstrm, b"<pywrapfst>")
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2237
 *     with nogil:
 *       _result = self._fst.get().Write(_sstrm, b"<pywrapfst>")
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()
*/
  __pyx_t_6 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_6)) {

    /* "pywrapfst.pyx":2238
 *       _result = self._fst.get().Write(_sstrm, b"<pywrapfst>")
 *     if not _result:
 *       raise FstIOError("Write to string failed")             # <<<<<<<<<<<<<<
 *     return _sstrm.str()
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Write_to_string_failed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 2238, __pyx_L1_error)

    /* "pywrapfst.pyx":2237
 *     with nogil:
 *       _result = self._fst.get().Write(_sstrm, b"<pywrapfst>")
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIOError("Write to string failed")
 *     return _sstrm.str()
*/
  }

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

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

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst.Fst.write_to_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_3Fst_53write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_3Fst_52write_to_string, "\n    write_to_string(self)\n\n    Serializes FST to a string.\n\n    Returns:\n      A bytestring.\n\n    Raises:\n      FstIOError: Write to string failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_3Fst_53write_to_string = {"write_to_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_53write_to_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_52write_to_string};
static PyObject *__pyx_pw_9pywrapfst_3Fst_53write_to_string(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write_to_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("write_to_string", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("write_to_string", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_3Fst_52write_to_string(((struct __pyx_obj_9pywrapfst_Fst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_3Fst_52write_to_string(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write_to_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_3Fst_write_to_string(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2221, __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":2252
 *   """
 * 
 *   cdef void _check_mutating_imethod(self) except *:             # <<<<<<<<<<<<<<
 *     """Checks whether an operation mutating the FST has produced an error.
 * 
*/

static void __pyx_f_9pywrapfst_10MutableFst__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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_mutating_imethod", 0);

  /* "pywrapfst.pyx":2257
 *     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, 2257, __pyx_L1_error)
  }
  __pyx_t_1 = (__pyx_v_self->__pyx_base._fst.get()->Properties(fst::kError, 1) == fst::kError);
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":2258
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 * 
 *   cdef void _add_arc(self, int64_t state, Arc arc) except *:
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Operation_failed};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2258, __pyx_L1_error)

    /* "pywrapfst.pyx":2257
 *     This function is not visible to Python users.
 *     """
 *     if self._fst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Operation failed")
 * 
*/
  }

  /* "pywrapfst.pyx":2252
 *   """
 * 
 *   cdef void _check_mutating_imethod(self) except *:             # <<<<<<<<<<<<<<
 *     """Checks whether an operation mutating the FST has produced an error.
 * 
*/

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

/* "pywrapfst.pyx":2260
 *       raise FstOpError("Operation failed")
 * 
 *   cdef void _add_arc(self, int64_t state, Arc arc) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

static void __pyx_f_9pywrapfst_10MutableFst__add_arc(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc) {
  bool __pyx_v__result;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_add_arc", 0);

  /* "pywrapfst.pyx":2262
 *   cdef void _add_arc(self, int64_t state, Arc arc) except *:
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._fst.get().ValidStateId(state)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2263
 *     cdef bool _result
 *     with nogil:
 *       _result = self._fst.get().ValidStateId(state)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIndexError("State index out of range")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2263, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_self->__pyx_base._fst.get()->ValidStateId(__pyx_v_state);
      }

      /* "pywrapfst.pyx":2262
 *   cdef void _add_arc(self, int64_t state, Arc arc) except *:
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._fst.get().ValidStateId(state)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2264
 *     with nogil:
 *       _result = self._fst.get().ValidStateId(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     with nogil:
*/
  __pyx_t_1 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":2265
 *       _result = self._fst.get().ValidStateId(state)
 *     if not _result:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     with nogil:
 *       _result = self._mfst.get().AddArc(state, deref(arc._arc))
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2265, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2265, __pyx_L1_error)

    /* "pywrapfst.pyx":2264
 *     with nogil:
 *       _result = self._fst.get().ValidStateId(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     with nogil:
*/
  }

  /* "pywrapfst.pyx":2266
 *     if not _result:
 *       raise FstIndexError("State index out of range")
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._mfst.get().AddArc(state, deref(arc._arc))
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2267
 *       raise FstIndexError("State index out of range")
 *     with nogil:
 *       _result = self._mfst.get().AddArc(state, deref(arc._arc))             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstOpError("Incompatible or invalid weight type")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2267, __pyx_L8_error)
        }
        if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2267, __pyx_L8_error)
        }
        __pyx_v__result = __pyx_v_self->_mfst.get()->AddArc(__pyx_v_state, (*__pyx_v_arc->_arc));
      }

      /* "pywrapfst.pyx":2266
 *     if not _result:
 *       raise FstIndexError("State index out of range")
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._mfst.get().AddArc(state, deref(arc._arc))
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L9;
        }
        __pyx_L8_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L9:;
      }
  }

  /* "pywrapfst.pyx":2268
 *     with nogil:
 *       _result = self._mfst.get().AddArc(state, deref(arc._arc))
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
*/
  __pyx_t_1 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":2269
 *       _result = self._mfst.get().AddArc(state, deref(arc._arc))
 *     if not _result:
 *       raise FstOpError("Incompatible or invalid weight type")             # <<<<<<<<<<<<<<
 * 
 *   def add_arc(self, int64_t state, Arc arc):
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2269, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Incompatible_or_invalid_weight_t};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2269, __pyx_L1_error)

    /* "pywrapfst.pyx":2268
 *     with nogil:
 *       _result = self._mfst.get().AddArc(state, deref(arc._arc))
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
*/
  }

  /* "pywrapfst.pyx":2260
 *       raise FstOpError("Operation failed")
 * 
 *   cdef void _add_arc(self, int64_t state, Arc arc) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

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

/* "pywrapfst.pyx":2271
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
 *   def add_arc(self, int64_t state, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     add_arc(self, state, arc)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_1add_arc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_add_arc, "\n    add_arc(self, state, arc)\n\n    Adds a new arc to the FST and return self.\n\n    Args:\n      state: The integer index of the source state.\n      arc: The arc to add.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n      FstOpdexError: Incompatible or invalid weight type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_1add_arc = {"add_arc", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_1add_arc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_add_arc};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_1add_arc(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_arc (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_arc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2271, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2271, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_arc", 0) < 0) __PYX_ERR(0, 2271, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, i); __PYX_ERR(0, 2271, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2271, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2271, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2271, __pyx_L3_error)
    __pyx_v_arc = ((struct __pyx_obj_9pywrapfst_Arc *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_arc", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2271, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 2271, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_add_arc(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_arc", 0);

  /* "pywrapfst.pyx":2288
 *       FstOpdexError: Incompatible or invalid weight type.
 *     """
 *     self._add_arc(state, arc)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_add_arc");
    __PYX_ERR(0, 2288, __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, 2288, __pyx_L1_error)

  /* "pywrapfst.pyx":2289
 *     """
 *     self._add_arc(state, arc)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64_t add_state(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2271
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
 *   def add_arc(self, int64_t 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":2291
 *     return self
 * 
 *   cpdef int64_t add_state(self):             # <<<<<<<<<<<<<<
 *     """
 *     add_state(self)
*/

static PyObject *__pyx_pw_9pywrapfst_10MutableFst_3add_state(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int64_t __pyx_f_9pywrapfst_10MutableFst_add_state(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch) {
  int64_t __pyx_v__state;
  int64_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;
  int64_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_state", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_10MutableFst_3add_state)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2291, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2301
 *     """
 *     cdef int64_t _state
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _state = self._mfst.get().AddState()
 *     return _state
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2302
 *     cdef int64_t _state
 *     with nogil:
 *       _state = self._mfst.get().AddState()             # <<<<<<<<<<<<<<
 *     return _state
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2302, __pyx_L4_error)
        }
        __pyx_v__state = __pyx_v_self->_mfst.get()->AddState();
      }

      /* "pywrapfst.pyx":2301
 *     """
 *     cdef int64_t _state
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _state = self._mfst.get().AddState()
 *     return _state
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2303
 *     with nogil:
 *       _state = self._mfst.get().AddState()
 *     return _state             # <<<<<<<<<<<<<<
 * 
 *   cpdef void add_states(self, size_t n):
*/
  __pyx_r = __pyx_v__state;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2291
 *     return self
 * 
 *   cpdef int64_t add_state(self):             # <<<<<<<<<<<<<<
 *     """
 *     add_state(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_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_10MutableFst_3add_state(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_2add_state, "\n    add_state(self)\n\n    Adds a new state to the FST and returns the state ID.\n\n    Returns:\n      The integer index of the new state.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_3add_state = {"add_state", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_3add_state, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_2add_state};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_3add_state(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_state (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("add_state", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("add_state", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_2add_state(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_2add_state(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_state", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_10MutableFst_add_state(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2291, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2291, __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":2305
 *     return _state
 * 
 *   cpdef void add_states(self, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     add_states(self, n)
*/

static PyObject *__pyx_pw_9pywrapfst_10MutableFst_5add_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_10MutableFst_add_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_states", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2305, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_10MutableFst_5add_states)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2305, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2305, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2314
 *       n: The number of states to add.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mfst.get().AddStates(n)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2315
 *     """
 *     with nogil:
 *       self._mfst.get().AddStates(n)             # <<<<<<<<<<<<<<
 * 
 *   cdef void _arcsort(self, sort_type="ilabel") except *:
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2315, __pyx_L4_error)
        }
        __pyx_v_self->_mfst.get()->AddStates(__pyx_v_n);
      }

      /* "pywrapfst.pyx":2314
 *       n: The number of states to add.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mfst.get().AddStates(n)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2305
 *     return _state
 * 
 *   cpdef void add_states(self, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     add_states(self, n)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.MutableFst.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_5add_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_4add_states, "\n    add_states(self, n)\n\n    Adds n new states to the FST.\n\n    Args:\n      n: The number of states to add.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_5add_states = {"add_states", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_5add_states, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_4add_states};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_5add_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_n;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_states (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2305, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2305, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add_states", 0) < 0) __PYX_ERR(0, 2305, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add_states", 1, 1, 1, i); __PYX_ERR(0, 2305, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2305, __pyx_L3_error)
    }
    __pyx_v_n = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_states", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2305, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.MutableFst.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_4add_states(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_n);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_4add_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, size_t __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_states", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_10MutableFst_add_states(__pyx_v_self, __pyx_v_n, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2305, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2305, __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.add_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2317
 *       self._mfst.get().AddStates(n)
 * 
 *   cdef void _arcsort(self, sort_type="ilabel") except *:             # <<<<<<<<<<<<<<
 *     cdef fst.ArcSortType _sort_type
 *     cdef string _sort_type_string = tostring(sort_type)
*/

static void __pyx_f_9pywrapfst_10MutableFst__arcsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args) {
  PyObject *__pyx_v_sort_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_ilabel);
  fst::script::ArcSortType __pyx_v__sort_type;
  std::string __pyx_v__sort_type_string;
  bool __pyx_v__result;
  __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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_arcsort", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_sort_type = __pyx_optional_args->sort_type;
    }
  }

  /* "pywrapfst.pyx":2319
 *   cdef void _arcsort(self, sort_type="ilabel") except *:
 *     cdef fst.ArcSortType _sort_type
 *     cdef string _sort_type_string = tostring(sort_type)             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_sort_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2319, __pyx_L1_error)
  __pyx_v__sort_type_string = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":2321
 *     cdef string _sort_type_string = tostring(sort_type)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = fst.GetArcSortType(_sort_type_string, addr(_sort_type))
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2322
 *     cdef bool _result
 *     with nogil:
 *       _result = fst.GetArcSortType(_sort_type_string, addr(_sort_type))             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
*/
        __pyx_v__result = fst::script::GetArcSortType(__pyx_v__sort_type_string, (&__pyx_v__sort_type));
      }

      /* "pywrapfst.pyx":2321
 *     cdef string _sort_type_string = tostring(sort_type)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = fst.GetArcSortType(_sort_type_string, addr(_sort_type))
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2323
 *     with nogil:
 *       _result = fst.GetArcSortType(_sort_type_string, addr(_sort_type))
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
 *     with nogil:
*/
  __pyx_t_2 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":2324
 *       _result = fst.GetArcSortType(_sort_type_string, addr(_sort_type))
 *     if not _result:
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.ArcSort(self._mfst.get(), _sort_type)
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sort_type), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_sort_type, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2324, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2324, __pyx_L1_error)

    /* "pywrapfst.pyx":2323
 *     with nogil:
 *       _result = fst.GetArcSortType(_sort_type_string, addr(_sort_type))
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
 *     with nogil:
*/
  }

  /* "pywrapfst.pyx":2325
 *     if not _result:
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.ArcSort(self._mfst.get(), _sort_type)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2326
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
 *     with nogil:
 *       fst.ArcSort(self._mfst.get(), _sort_type)             # <<<<<<<<<<<<<<
 * 
 *   def arcsort(self, sort_type="ilabel"):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2326, __pyx_L8_error)
        }
        fst::script::ArcSort(__pyx_v_self->_mfst.get(), __pyx_v__sort_type);
      }

      /* "pywrapfst.pyx":2325
 *     if not _result:
 *       raise FstArgError(f"Unknown sort type: {sort_type!r}")
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.ArcSort(self._mfst.get(), _sort_type)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L9;
        }
        __pyx_L8_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L9:;
      }
  }

  /* "pywrapfst.pyx":2317
 *       self._mfst.get().AddStates(n)
 * 
 *   cdef void _arcsort(self, sort_type="ilabel") except *:             # <<<<<<<<<<<<<<
 *     cdef fst.ArcSortType _sort_type
 *     cdef string _sort_type_string = tostring(sort_type)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst.MutableFst._arcsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2328
 *       fst.ArcSort(self._mfst.get(), _sort_type)
 * 
 *   def arcsort(self, sort_type="ilabel"):             # <<<<<<<<<<<<<<
 *     """
 *     arcsort(self, sort_type="ilabel")
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_7arcsort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_6arcsort, "\n    arcsort(self, sort_type=\"ilabel\")\n\n    Sorts arcs leaving each state of the FST.\n\n    This operation destructively sorts arcs leaving each state using either\n    input or output labels.\n\n    Args:\n      sort_type: Either \"ilabel\" (sort arcs according to input labels) or\n          \"olabel\" (sort arcs according to output labels).\n\n    Returns:\n      self.\n\n    Raises:\n      FstArgError: Unknown sort type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_7arcsort = {"arcsort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_7arcsort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_6arcsort};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_7arcsort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_sort_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arcsort (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_sort_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2328, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2328, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "arcsort", 0) < 0) __PYX_ERR(0, 2328, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_ilabel));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2328, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_ilabel));
    }
    __pyx_v_sort_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arcsort", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 2328, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_6arcsort(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_sort_type);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_6arcsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_sort_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcsort", 0);

  /* "pywrapfst.pyx":2347
 *       FstArgError: Unknown sort type.
 *     """
 *     self._arcsort(sort_type)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arcsort");
    __PYX_ERR(0, 2347, __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, 2347, __pyx_L1_error)

  /* "pywrapfst.pyx":2348
 *     """
 *     self._arcsort(sort_type)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _closure(self, closure_type="star"):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2328
 *       fst.ArcSort(self._mfst.get(), _sort_type)
 * 
 *   def arcsort(self, sort_type="ilabel"):             # <<<<<<<<<<<<<<
 *     """
 *     arcsort(self, sort_type="ilabel")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("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":2350
 *     return self
 * 
 *   cdef void _closure(self, closure_type="star"):             # <<<<<<<<<<<<<<
 *     cdef fst.ClosureType _type = _get_closure_type(tostring(closure_type))
 *     with nogil:
*/

static void __pyx_f_9pywrapfst_10MutableFst__closure(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__closure *__pyx_optional_args) {
  PyObject *__pyx_v_closure_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_star);
  enum fst::ClosureType __pyx_v__type;
  std::string __pyx_t_1;
  enum fst::ClosureType __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_closure_type = __pyx_optional_args->closure_type;
    }
  }

  /* "pywrapfst.pyx":2351
 * 
 *   cdef void _closure(self, closure_type="star"):
 *     cdef fst.ClosureType _type = _get_closure_type(tostring(closure_type))             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Closure(self._mfst.get(), _type)
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_closure_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_closure_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2351, __pyx_L1_error)
  __pyx_v__type = __pyx_t_2;

  /* "pywrapfst.pyx":2352
 *   cdef void _closure(self, closure_type="star"):
 *     cdef fst.ClosureType _type = _get_closure_type(tostring(closure_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Closure(self._mfst.get(), _type)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2353
 *     cdef fst.ClosureType _type = _get_closure_type(tostring(closure_type))
 *     with nogil:
 *       fst.Closure(self._mfst.get(), _type)             # <<<<<<<<<<<<<<
 * 
 *   def closure(self, closure_type="star"):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2353, __pyx_L4_error)
        }
        fst::script::Closure(__pyx_v_self->_mfst.get(), __pyx_v__type);
      }

      /* "pywrapfst.pyx":2352
 *   cdef void _closure(self, closure_type="star"):
 *     cdef fst.ClosureType _type = _get_closure_type(tostring(closure_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Closure(self._mfst.get(), _type)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2350
 *     return self
 * 
 *   cdef void _closure(self, closure_type="star"):             # <<<<<<<<<<<<<<
 *     cdef fst.ClosureType _type = _get_closure_type(tostring(closure_type))
 *     with nogil:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._closure", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2355
 *       fst.Closure(self._mfst.get(), _type)
 * 
 *   def closure(self, closure_type="star"):             # <<<<<<<<<<<<<<
 *     """
 *     closure(self, closure_type="star")
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_9closure(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_8closure, "\n    closure(self, closure_type=\"star\")\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_type` is \"star\".\n\n    Args:\n      closure_type: If \"star\", do not accept the empty string. If \"plus\", accept\n      the empty string.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_9closure = {"closure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_9closure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_8closure};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_9closure(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_closure_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("closure (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_closure_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2355, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "closure", 0) < 0) __PYX_ERR(0, 2355, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_star));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2355, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_star));
    }
    __pyx_v_closure_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("closure", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 2355, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_8closure(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_closure_type);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_8closure(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_closure_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__closure __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("closure", 0);

  /* "pywrapfst.pyx":2374
 *       self.
 *     """
 *     self._closure(closure_type)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_closure");
    __PYX_ERR(0, 2374, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.closure_type = __pyx_v_closure_type;
  ((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, 2374, __pyx_L1_error)

  /* "pywrapfst.pyx":2375
 *     """
 *     self._closure(closure_type)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _concat(self, Fst fst2) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2355
 *       fst.Closure(self._mfst.get(), _type)
 * 
 *   def closure(self, closure_type="star"):             # <<<<<<<<<<<<<<
 *     """
 *     closure(self, closure_type="star")
*/

  /* 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":2377
 *     return self
 * 
 *   cdef void _concat(self, Fst fst2) except *:             # <<<<<<<<<<<<<<
 *     cdef const_FstClass_ptr other = fst2._fst.get()
 *     with nogil:
*/

static void __pyx_f_9pywrapfst_10MutableFst__concat(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst2) {
  __pyx_t_9pywrapfst_const_FstClass_ptr __pyx_v_other;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":2378
 * 
 *   cdef void _concat(self, Fst fst2) except *:
 *     cdef const_FstClass_ptr other = fst2._fst.get()             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Concat(self._mfst.get(), deref(other))
*/
  if (unlikely(((PyObject *)__pyx_v_fst2) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2378, __pyx_L1_error)
  }
  __pyx_v_other = __pyx_v_fst2->_fst.get();

  /* "pywrapfst.pyx":2379
 *   cdef void _concat(self, Fst fst2) except *:
 *     cdef const_FstClass_ptr other = fst2._fst.get()
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Concat(self._mfst.get(), deref(other))
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2380
 *     cdef const_FstClass_ptr other = fst2._fst.get()
 *     with nogil:
 *       fst.Concat(self._mfst.get(), deref(other))             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2380, __pyx_L4_error)
        }
        fst::script::Concat(__pyx_v_self->_mfst.get(), (*__pyx_v_other));
      }

      /* "pywrapfst.pyx":2379
 *   cdef void _concat(self, Fst fst2) except *:
 *     cdef const_FstClass_ptr other = fst2._fst.get()
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Concat(self._mfst.get(), deref(other))
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2381
 *     with nogil:
 *       fst.Concat(self._mfst.get(), deref(other))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def concat(self, Fst fst2):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2381, __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, 2381, __pyx_L1_error)

  /* "pywrapfst.pyx":2377
 *     return self
 * 
 *   cdef void _concat(self, Fst fst2) except *:             # <<<<<<<<<<<<<<
 *     cdef const_FstClass_ptr other = fst2._fst.get()
 *     with nogil:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2383
 *     self._check_mutating_imethod()
 * 
 *   def concat(self, Fst fst2):             # <<<<<<<<<<<<<<
 *     """
 *     concat(self, fst2)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_11concat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_10concat, "\n    concat(self, fst2)\n\n    Computes the concatenation (product) of two FSTs.\n\n    This operation destructively concatenates the FST with a second FST. If A\n    transduces string x to y with weight a and B transduces string w to v with\n    weight b, then their concatenation transduces string xw to yv with weight a\n    \\otimes b.\n\n    Args:\n      fst2: The second input FST.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_11concat = {"concat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_11concat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_10concat};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_11concat(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst2 = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("concat (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fst2,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2383, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2383, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "concat", 0) < 0) __PYX_ERR(0, 2383, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("concat", 1, 1, 1, i); __PYX_ERR(0, 2383, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2383, __pyx_L3_error)
    }
    __pyx_v_fst2 = ((struct __pyx_obj_9pywrapfst_Fst *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("concat", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2383, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.MutableFst.concat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "fst2", 0))) __PYX_ERR(0, 2383, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_10concat(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_fst2);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_10concat(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_fst2) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("concat", 0);

  /* "pywrapfst.pyx":2400
 *       self.
 *     """
 *     self._concat(fst2)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_concat");
    __PYX_ERR(0, 2400, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_concat(__pyx_v_self, __pyx_v_fst2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2400, __pyx_L1_error)

  /* "pywrapfst.pyx":2401
 *     """
 *     self._concat(fst2)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _connect(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2383
 *     self._check_mutating_imethod()
 * 
 *   def concat(self, Fst fst2):             # <<<<<<<<<<<<<<
 *     """
 *     concat(self, fst2)
*/

  /* 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":2403
 *     return self
 * 
 *   cdef void _connect(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Connect(self._mfst.get())
*/

static void __pyx_f_9pywrapfst_10MutableFst__connect(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":2404
 * 
 *   cdef void _connect(self):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Connect(self._mfst.get())
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2405
 *   cdef void _connect(self):
 *     with nogil:
 *       fst.Connect(self._mfst.get())             # <<<<<<<<<<<<<<
 * 
 *   def connect(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2405, __pyx_L4_error)
        }
        fst::script::Connect(__pyx_v_self->_mfst.get());
      }

      /* "pywrapfst.pyx":2404
 * 
 *   cdef void _connect(self):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Connect(self._mfst.get())
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2403
 *     return self
 * 
 *   cdef void _connect(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Connect(self._mfst.get())
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2407
 *       fst.Connect(self._mfst.get())
 * 
 *   def connect(self):             # <<<<<<<<<<<<<<
 *     """
 *     connect(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_13connect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_12connect, "\n    connect(self)\n\n    Removes unsuccessful paths.\n\n    This operation destructively trims the FST, removing states and arcs that\n    are not part of any successful path.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_13connect = {"connect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_13connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_12connect};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_13connect(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("connect", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("connect", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_12connect(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_12connect(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("connect", 0);

  /* "pywrapfst.pyx":2419
 *       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, 2419, __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, 2419, __pyx_L1_error)

  /* "pywrapfst.pyx":2420
 *     """
 *     self._connect()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2407
 *       fst.Connect(self._mfst.get())
 * 
 *   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":2422
 *     return self
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Decode(self._mfst.get(), deref(mapper._mapper))
*/

static void __pyx_f_9pywrapfst_10MutableFst__decode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":2423
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Decode(self._mfst.get(), deref(mapper._mapper))
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2424
 *   cdef void _decode(self, EncodeMapper mapper) except *:
 *     with nogil:
 *       fst.Decode(self._mfst.get(), deref(mapper._mapper))             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2424, __pyx_L4_error)
        }
        if (unlikely(((PyObject *)__pyx_v_mapper) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2424, __pyx_L4_error)
        }
        fst::script::Decode(__pyx_v_self->_mfst.get(), (*__pyx_v_mapper->_mapper));
      }

      /* "pywrapfst.pyx":2423
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Decode(self._mfst.get(), deref(mapper._mapper))
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2425
 *     with nogil:
 *       fst.Decode(self._mfst.get(), deref(mapper._mapper))
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def decode(self, EncodeMapper mapper):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2425, __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, 2425, __pyx_L1_error)

  /* "pywrapfst.pyx":2422
 *     return self
 * 
 *   cdef void _decode(self, EncodeMapper mapper) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Decode(self._mfst.get(), deref(mapper._mapper))
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2427
 *     self._check_mutating_imethod()
 * 
 *   def decode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     decode(self, mapper)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_15decode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_14decode, "\n    decode(self, mapper)\n\n    Decodes encoded labels and/or weights.\n\n    This operation reverses the encoding performed by `encode`.\n\n    Args:\n      mapper: An EncodeMapper object used to encode the FST.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_15decode = {"decode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_15decode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_14decode};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_15decode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decode (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mapper,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2427, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2427, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "decode", 0) < 0) __PYX_ERR(0, 2427, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("decode", 1, 1, 1, i); __PYX_ERR(0, 2427, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2427, __pyx_L3_error)
    }
    __pyx_v_mapper = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("decode", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2427, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.MutableFst.decode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2427, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_14decode(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_mapper);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_14decode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("decode", 0);

  /* "pywrapfst.pyx":2441
 *       self.
 *     """
 *     self._decode(mapper)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_decode");
    __PYX_ERR(0, 2441, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_decode(__pyx_v_self, __pyx_v_mapper); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2441, __pyx_L1_error)

  /* "pywrapfst.pyx":2442
 *     """
 *     self._decode(mapper)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _delete_arcs(self, int64_t 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":2427
 *     self._check_mutating_imethod()
 * 
 *   def decode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     decode(self, mapper)
*/

  /* 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":2444
 *     return self
 * 
 *   cdef void _delete_arcs(self, int64_t state, size_t n=0) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     if n:
*/

static void __pyx_f_9pywrapfst_10MutableFst__delete_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_arcs *__pyx_optional_args) {
  size_t __pyx_v_n = ((size_t)0);
  bool __pyx_v__result;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_delete_arcs", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_n = __pyx_optional_args->n;
    }
  }

  /* "pywrapfst.pyx":2446
 *   cdef void _delete_arcs(self, int64_t state, size_t n=0) except *:
 *     cdef bool _result
 *     if n:             # <<<<<<<<<<<<<<
 *       with nogil:
 *         _result = self._mfst.get().DeleteArcs(state, n)
*/
  __pyx_t_1 = (__pyx_v_n != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2447
 *     cdef bool _result
 *     if n:
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mfst.get().DeleteArcs(state, n)
 *     else:
*/
    {
        PyThreadState *_save;
        _save = NULL;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pywrapfst.pyx":2448
 *     if n:
 *       with nogil:
 *         _result = self._mfst.get().DeleteArcs(state, n)             # <<<<<<<<<<<<<<
 *     else:
 *       with nogil:
*/
          if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            __PYX_ERR(0, 2448, __pyx_L5_error)
          }
          __pyx_v__result = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state, __pyx_v_n);
        }

        /* "pywrapfst.pyx":2447
 *     cdef bool _result
 *     if n:
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mfst.get().DeleteArcs(state, n)
 *     else:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pywrapfst.pyx":2446
 *   cdef void _delete_arcs(self, int64_t state, size_t n=0) except *:
 *     cdef bool _result
 *     if n:             # <<<<<<<<<<<<<<
 *       with nogil:
 *         _result = self._mfst.get().DeleteArcs(state, n)
*/
    goto __pyx_L3;
  }

  /* "pywrapfst.pyx":2450
 *         _result = self._mfst.get().DeleteArcs(state, n)
 *     else:
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mfst.get().DeleteArcs(state)
 *     if not _result:
*/
  /*else*/ {
    {
        PyThreadState *_save;
        _save = NULL;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pywrapfst.pyx":2451
 *     else:
 *       with nogil:
 *         _result = self._mfst.get().DeleteArcs(state)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIndexError("State index out of range")
*/
          if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            __PYX_ERR(0, 2451, __pyx_L8_error)
          }
          __pyx_v__result = __pyx_v_self->_mfst.get()->DeleteArcs(__pyx_v_state);
        }

        /* "pywrapfst.pyx":2450
 *         _result = self._mfst.get().DeleteArcs(state, n)
 *     else:
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mfst.get().DeleteArcs(state)
 *     if not _result:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pywrapfst.pyx":2452
 *       with nogil:
 *         _result = self._mfst.get().DeleteArcs(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()
*/
  __pyx_t_1 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":2453
 *         _result = self._mfst.get().DeleteArcs(state)
 *     if not _result:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2453, __pyx_L1_error)

    /* "pywrapfst.pyx":2452
 *       with nogil:
 *         _result = self._mfst.get().DeleteArcs(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()
*/
  }

  /* "pywrapfst.pyx":2454
 *     if not _result:
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def delete_arcs(self, int64_t 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, 2454, __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, 2454, __pyx_L1_error)

  /* "pywrapfst.pyx":2444
 *     return self
 * 
 *   cdef void _delete_arcs(self, int64_t state, size_t n=0) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     if n:
*/

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

/* "pywrapfst.pyx":2456
 *     self._check_mutating_imethod()
 * 
 *   def delete_arcs(self, int64_t state, size_t n=0):             # <<<<<<<<<<<<<<
 *     """
 *     delete_arcs(self, state, n=0)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_17delete_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_16delete_arcs, "\n    delete_arcs(self, state, n=0)\n\n    Deletes arcs leaving a particular state.\n\n    Args:\n      state: The integer index of a state.\n      n: An optional argument indicating how many arcs to be deleted. If this\n          argument is omitted or passed as zero, all arcs from this state are\n          deleted.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_17delete_arcs = {"delete_arcs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_17delete_arcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_16delete_arcs};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_17delete_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  size_t __pyx_v_n;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_arcs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2456, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "delete_arcs", 0) < 0) __PYX_ERR(0, 2456, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, i); __PYX_ERR(0, 2456, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2456, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2456, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2456, __pyx_L3_error)
    if (values[1]) {
      __pyx_v_n = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2456, __pyx_L3_error)
    } else {
      __pyx_v_n = ((size_t)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete_arcs", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2456, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_16delete_arcs(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_16delete_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, size_t __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_arcs __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_arcs", 0);

  /* "pywrapfst.pyx":2474
 *       FstIndexError: State index out of range.
 *     """
 *     self._delete_arcs(state, n)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_delete_arcs");
    __PYX_ERR(0, 2474, __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, 2474, __pyx_L1_error)

  /* "pywrapfst.pyx":2475
 *     """
 *     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":2456
 *     self._check_mutating_imethod()
 * 
 *   def delete_arcs(self, int64_t 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":2477
 *     return self
 * 
 *   cdef void _delete_states(self, states=None) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     cdef vector[int64_t] _states
*/

static void __pyx_f_9pywrapfst_10MutableFst__delete_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_states *__pyx_optional_args) {
  PyObject *__pyx_v_states = ((PyObject *)Py_None);
  bool __pyx_v__result;
  std::vector<int64_t>  __pyx_v__states;
  int64_t __pyx_v__state;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  int64_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_delete_states", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_states = __pyx_optional_args->states;
    }
  }

  /* "pywrapfst.pyx":2481
 *     cdef vector[int64_t] _states
 *     cdef int64_t _state
 *     if states:             # <<<<<<<<<<<<<<
 *       for _state in states:
 *         _states.push_back(_state)
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_states); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2481, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2482
 *     cdef int64_t _state
 *     if states:
 *       for _state in states:             # <<<<<<<<<<<<<<
 *         _states.push_back(_state)
 *       with nogil:
*/
    if (likely(PyList_CheckExact(__pyx_v_states)) || PyTuple_CheckExact(__pyx_v_states)) {
      __pyx_t_2 = __pyx_v_states; __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_states); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2482, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2482, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2482, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2482, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2482, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyLong_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2482, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v__state = __pyx_t_6;

      /* "pywrapfst.pyx":2483
 *     if states:
 *       for _state in states:
 *         _states.push_back(_state)             # <<<<<<<<<<<<<<
 *       with nogil:
 *         _result = self._mfst.get().DeleteStates(_states)
*/
      try {
        __pyx_v__states.push_back(__pyx_v__state);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2483, __pyx_L1_error)
      }

      /* "pywrapfst.pyx":2482
 *     cdef int64_t _state
 *     if states:
 *       for _state in states:             # <<<<<<<<<<<<<<
 *         _states.push_back(_state)
 *       with nogil:
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pywrapfst.pyx":2484
 *       for _state in states:
 *         _states.push_back(_state)
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mfst.get().DeleteStates(_states)
 *       if not _result:
*/
    {
        PyThreadState *_save;
        _save = NULL;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pywrapfst.pyx":2485
 *         _states.push_back(_state)
 *       with nogil:
 *         _result = self._mfst.get().DeleteStates(_states)             # <<<<<<<<<<<<<<
 *       if not _result:
 *         raise FstIndexError("State index out of range")
*/
          if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            __PYX_ERR(0, 2485, __pyx_L8_error)
          }
          __pyx_v__result = __pyx_v_self->_mfst.get()->DeleteStates(__pyx_v__states);
        }

        /* "pywrapfst.pyx":2484
 *       for _state in states:
 *         _states.push_back(_state)
 *       with nogil:             # <<<<<<<<<<<<<<
 *         _result = self._mfst.get().DeleteStates(_states)
 *       if not _result:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }

    /* "pywrapfst.pyx":2486
 *       with nogil:
 *         _result = self._mfst.get().DeleteStates(_states)
 *       if not _result:             # <<<<<<<<<<<<<<
 *         raise FstIndexError("State index out of range")
 *     else:
*/
    __pyx_t_1 = (!(__pyx_v__result != 0));
    if (unlikely(__pyx_t_1)) {

      /* "pywrapfst.pyx":2487
 *         _result = self._mfst.get().DeleteStates(_states)
 *       if not _result:
 *         raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     else:
 *       # This version can't fail.
*/
      __pyx_t_5 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2487, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_7, __pyx__function);
        __pyx_t_8 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2487, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 2487, __pyx_L1_error)

      /* "pywrapfst.pyx":2486
 *       with nogil:
 *         _result = self._mfst.get().DeleteStates(_states)
 *       if not _result:             # <<<<<<<<<<<<<<
 *         raise FstIndexError("State index out of range")
 *     else:
*/
    }

    /* "pywrapfst.pyx":2481
 *     cdef vector[int64_t] _states
 *     cdef int64_t _state
 *     if states:             # <<<<<<<<<<<<<<
 *       for _state in states:
 *         _states.push_back(_state)
*/
    goto __pyx_L3;
  }

  /* "pywrapfst.pyx":2490
 *     else:
 *       # This version can't fail.
 *       with nogil:             # <<<<<<<<<<<<<<
 *         self._mfst.get().DeleteStates()
 *     self._check_mutating_imethod()
*/
  /*else*/ {
    {
        PyThreadState *_save;
        _save = NULL;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pywrapfst.pyx":2491
 *       # This version can't fail.
 *       with nogil:
 *         self._mfst.get().DeleteStates()             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
          if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            __PYX_ERR(0, 2491, __pyx_L12_error)
          }
          __pyx_v_self->_mfst.get()->DeleteStates();
        }

        /* "pywrapfst.pyx":2490
 *     else:
 *       # This version can't fail.
 *       with nogil:             # <<<<<<<<<<<<<<
 *         self._mfst.get().DeleteStates()
 *     self._check_mutating_imethod()
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L13;
          }
          __pyx_L12_error: {
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L1_error;
          }
          __pyx_L13:;
        }
    }
  }
  __pyx_L3:;

  /* "pywrapfst.pyx":2492
 *       with nogil:
 *         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, 2492, __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, 2492, __pyx_L1_error)

  /* "pywrapfst.pyx":2477
 *     return self
 * 
 *   cdef void _delete_states(self, states=None) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     cdef vector[int64_t] _states
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst.MutableFst._delete_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2494
 *     self._check_mutating_imethod()
 * 
 *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
 *     """
 *     delete_states(self, states=None)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_19delete_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_18delete_states, "\n    delete_states(self, states=None)\n\n    Deletes states.\n\n    Args:\n      states: An optional iterable of integer indices of the states to be\n          deleted. If this argument is omitted, all states are deleted.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_19delete_states = {"delete_states", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_19delete_states, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_18delete_states};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_19delete_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_states = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_states (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_states,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2494, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2494, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "delete_states", 0) < 0) __PYX_ERR(0, 2494, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2494, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_states = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("delete_states", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 2494, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_18delete_states(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_states);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_18delete_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_states) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_states __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("delete_states", 0);

  /* "pywrapfst.pyx":2510
 *       FstIndexError: State index out of range.
 *     """
 *     self._delete_states(states)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_delete_states");
    __PYX_ERR(0, 2510, __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, 2510, __pyx_L1_error)

  /* "pywrapfst.pyx":2511
 *     """
 *     self._delete_states(states)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2494
 *     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":2513
 *     return self
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Encode(self._mfst.get(), mapper._mapper.get())
*/

static void __pyx_f_9pywrapfst_10MutableFst__encode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":2514
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Encode(self._mfst.get(), mapper._mapper.get())
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2515
 *   cdef void _encode(self, EncodeMapper mapper) except *:
 *     with nogil:
 *       fst.Encode(self._mfst.get(), mapper._mapper.get())             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2515, __pyx_L4_error)
        }
        if (unlikely(((PyObject *)__pyx_v_mapper) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mapper");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2515, __pyx_L4_error)
        }
        fst::script::Encode(__pyx_v_self->_mfst.get(), __pyx_v_mapper->_mapper.get());
      }

      /* "pywrapfst.pyx":2514
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Encode(self._mfst.get(), mapper._mapper.get())
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2516
 *     with nogil:
 *       fst.Encode(self._mfst.get(), mapper._mapper.get())
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def encode(self, EncodeMapper mapper):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2516, __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, 2516, __pyx_L1_error)

  /* "pywrapfst.pyx":2513
 *     return self
 * 
 *   cdef void _encode(self, EncodeMapper mapper) except *:             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Encode(self._mfst.get(), mapper._mapper.get())
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2518
 *     self._check_mutating_imethod()
 * 
 *   def encode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     encode(self, mapper)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_21encode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_20encode, "\n    encode(self, mapper)\n\n    Encodes labels and/or weights.\n\n    This operation allows for the representation of a weighted transducer as a\n    weighted acceptor, an unweighted transducer, or an unweighted acceptor by\n    considering the pair (input label, output label), the pair (input label,\n    weight), or the triple (input label, output label, weight) as a single\n    label. Applying this operation mutates the EncodeMapper argument, which\n    can then be used to decode.\n\n    Args:\n      mapper: An EncodeMapper object to be used as the mapper.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_21encode = {"encode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_21encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_20encode};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_21encode(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("encode (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_mapper,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2518, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2518, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "encode", 0) < 0) __PYX_ERR(0, 2518, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("encode", 1, 1, 1, i); __PYX_ERR(0, 2518, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2518, __pyx_L3_error)
    }
    __pyx_v_mapper = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("encode", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2518, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.MutableFst.encode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mapper), __pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, 1, "mapper", 0))) __PYX_ERR(0, 2518, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_20encode(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_mapper);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_20encode(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_EncodeMapper *__pyx_v_mapper) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("encode", 0);

  /* "pywrapfst.pyx":2537
 *       self.
 *     """
 *     self._encode(mapper)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_encode");
    __PYX_ERR(0, 2537, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_encode(__pyx_v_self, __pyx_v_mapper); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2537, __pyx_L1_error)

  /* "pywrapfst.pyx":2538
 *     """
 *     self._encode(mapper)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _invert(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2518
 *     self._check_mutating_imethod()
 * 
 *   def encode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     encode(self, mapper)
*/

  /* 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":2540
 *     return self
 * 
 *   cdef void _invert(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Invert(self._mfst.get())
*/

static void __pyx_f_9pywrapfst_10MutableFst__invert(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":2541
 * 
 *   cdef void _invert(self):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Invert(self._mfst.get())
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2542
 *   cdef void _invert(self):
 *     with nogil:
 *       fst.Invert(self._mfst.get())             # <<<<<<<<<<<<<<
 * 
 *   def invert(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2542, __pyx_L4_error)
        }
        fst::script::Invert(__pyx_v_self->_mfst.get());
      }

      /* "pywrapfst.pyx":2541
 * 
 *   cdef void _invert(self):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Invert(self._mfst.get())
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2540
 *     return self
 * 
 *   cdef void _invert(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Invert(self._mfst.get())
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._invert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2544
 *       fst.Invert(self._mfst.get())
 * 
 *   def invert(self):             # <<<<<<<<<<<<<<
 *     """
 *     invert(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_23invert(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_22invert, "\n    invert(self)\n\n    Inverts the FST's transduction.\n\n    This operation destructively inverts the FST's transduction by exchanging\n    input and output labels.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_23invert = {"invert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_23invert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_22invert};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_23invert(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("invert (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("invert", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("invert", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_22invert(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_22invert(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("invert", 0);

  /* "pywrapfst.pyx":2556
 *       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, 2556, __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, 2556, __pyx_L1_error)

  /* "pywrapfst.pyx":2557
 *     """
 *     self._invert()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _minimize(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2544
 *       fst.Invert(self._mfst.get())
 * 
 *   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":2559
 *     return self
 * 
 *   cdef void _minimize(self,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kShortestDelta,
 *                       bool allow_nondet=False) except *:
*/

static void __pyx_f_9pywrapfst_10MutableFst__minimize(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_mstate_global->__pyx_k__7;

  /* "pywrapfst.pyx":2561
 *   cdef void _minimize(self,
 *                       float delta=fst.kShortestDelta,
 *                       bool allow_nondet=False) except *:             # <<<<<<<<<<<<<<
 *     # This runs in-place when the second argument is null.
 *     with nogil:
*/
  bool __pyx_v_allow_nondet = ((bool)0);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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":2563
 *                       bool allow_nondet=False) except *:
 *     # This runs in-place when the second argument is null.
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2564
 *     # This runs in-place when the second argument is null.
 *     with nogil:
 *       fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2564, __pyx_L4_error)
        }
        fst::script::Minimize(__pyx_v_self->_mfst.get(), NULL, __pyx_v_delta, __pyx_v_allow_nondet);
      }

      /* "pywrapfst.pyx":2563
 *                       bool allow_nondet=False) except *:
 *     # This runs in-place when the second argument is null.
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Minimize(self._mfst.get(), NULL, delta, allow_nondet)
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2565
 *     with nogil:
 *       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, 2565, __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, 2565, __pyx_L1_error)

  /* "pywrapfst.pyx":2559
 *     return self
 * 
 *   cdef void _minimize(self,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kShortestDelta,
 *                       bool allow_nondet=False) except *:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._minimize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2567
 *     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_10MutableFst_25minimize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_24minimize, "\n    minimize(self, delta=1e-6, allow_nondet=False)\n\n    Minimizes the FST.\n\n    This operation destructively performs the minimization of deterministic\n    weighted automata and transducers. If the input FST A is an acceptor, this\n    operation produces the minimal acceptor B equivalent to A, i.e. the\n    acceptor with a minimal number of states that is equivalent to A. If the\n    input FST A is a transducer, this operation internally builds an equivalent\n    transducer with a minimal number of states. However, this minimality is\n    obtained by allowing transition having strings of symbols as output labels,\n    this known in the litterature as a real-time transducer. Such transducers\n    are not directly supported by the library. This function will convert such\n    transducer by expanding each string-labeled transition into a sequence of\n    transitions. This will results in the creation of new states, hence losing\n    the minimality property.\n\n    Args:\n      delta: Comparison/quantization delta.\n      allow_nondet: Attempt minimization of non-deterministic FST?\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_25minimize = {"minimize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_25minimize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_24minimize};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_25minimize(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  float __pyx_v_delta;
  bool __pyx_v_allow_nondet;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("minimize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_allow_nondet,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2567, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "minimize", 0) < 0) __PYX_ERR(0, 2567, __pyx_L3_error)
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2567, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2567, __pyx_L3_error)
        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, 2567, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__8;
    }
    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, 2567, __pyx_L3_error)
    } else {
      __pyx_v_allow_nondet = ((bool)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("minimize", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 2567, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_24minimize(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_allow_nondet);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_24minimize(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_10MutableFst__minimize __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("minimize", 0);

  /* "pywrapfst.pyx":2593
 *       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, 2593, __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, 2593, __pyx_L1_error)

  /* "pywrapfst.pyx":2594
 *     """
 *     self._minimize(delta, allow_nondet)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cpdef _MutableArcIterator mutable_arcs(self, int64_t state):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2567
 *     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":2596
 *     return self
 * 
 *   cpdef _MutableArcIterator mutable_arcs(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_arcs(self, state)
*/

static PyObject *__pyx_pw_9pywrapfst_10MutableFst_27mutable_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_f_9pywrapfst_10MutableFst_mutable_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mutable_arcs", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_mutable_arcs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_10MutableFst_27mutable_arcs)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2596, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2596, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator))))) __PYX_ERR(0, 2596, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2608
 *       A _MutableArcIterator.
 *     """
 *     return _MutableArcIterator(self, state)             # <<<<<<<<<<<<<<
 * 
 *   def mutable_input_symbols(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator); 
  __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_state); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2608, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2596
 *     return self
 * 
 *   cpdef _MutableArcIterator mutable_arcs(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_arcs(self, state)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("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_10MutableFst_27mutable_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_26mutable_arcs, "\n    mutable_arcs(self, state)\n\n    Returns a mutable iterator over arcs leaving the specified state.\n\n    Args:\n      state: The source state ID.\n\n    Returns:\n      A _MutableArcIterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_27mutable_arcs = {"mutable_arcs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_27mutable_arcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_26mutable_arcs};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_27mutable_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mutable_arcs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2596, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2596, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "mutable_arcs", 0) < 0) __PYX_ERR(0, 2596, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("mutable_arcs", 1, 1, 1, i); __PYX_ERR(0, 2596, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2596, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2596, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mutable_arcs", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2596, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_26mutable_arcs(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_26mutable_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mutable_arcs", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_10MutableFst_mutable_arcs(__pyx_v_self, __pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2596, __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":2610
 *     return _MutableArcIterator(self, state)
 * 
 *   def mutable_input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_input_symbols(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_29mutable_input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_28mutable_input_symbols, "\n    mutable_input_symbols(self)\n\n    Returns the FST's (mutable) input symbol table, or None if none is present.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_29mutable_input_symbols = {"mutable_input_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_29mutable_input_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_28mutable_input_symbols};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_29mutable_input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mutable_input_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mutable_input_symbols", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("mutable_input_symbols", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_28mutable_input_symbols(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_28mutable_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mutable_input_symbols", 0);

  /* "pywrapfst.pyx":2616
 *     Returns the FST's (mutable) input symbol table, or None if none is present.
 *     """
 *     if self._mfst.get().MutableInputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2616, __pyx_L1_error)
  }
  __pyx_t_1 = (__pyx_v_self->_mfst.get()->MutableInputSymbols() == NULL);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2617
 *     """
 *     if self._mfst.get().MutableInputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":2616
 *     Returns the FST's (mutable) input symbol table, or None if none is present.
 *     """
 *     if self._mfst.get().MutableInputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
*/
  }

  /* "pywrapfst.pyx":2618
 *     if self._mfst.get().MutableInputSymbols() == NULL:
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)             # <<<<<<<<<<<<<<
 * 
 *   def mutable_output_symbols(self):
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2618, __pyx_L1_error)
  }
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(__pyx_v_self->_mfst, 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2610
 *     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":2620
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 * 
 *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_output_symbols(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_31mutable_output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_30mutable_output_symbols, "\n    mutable_output_symbols(self)\n\n    Returns the FST's (mutable) output symbol table, or None if none is present.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_31mutable_output_symbols = {"mutable_output_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_31mutable_output_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_30mutable_output_symbols};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_31mutable_output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mutable_output_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("mutable_output_symbols", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("mutable_output_symbols", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_30mutable_output_symbols(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_30mutable_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("mutable_output_symbols", 0);

  /* "pywrapfst.pyx":2626
 *     Returns the FST's (mutable) output symbol table, or None if none is present.
 *     """
 *     if self._mfst.get().MutableOutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 2626, __pyx_L1_error)
  }
  __pyx_t_1 = (__pyx_v_self->_mfst.get()->MutableOutputSymbols() == NULL);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2627
 *     """
 *     if self._mfst.get().MutableOutputSymbols() == NULL:
 *       return             # <<<<<<<<<<<<<<
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 * 
*/
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "pywrapfst.pyx":2626
 *     Returns the FST's (mutable) output symbol table, or None if none is present.
 *     """
 *     if self._mfst.get().MutableOutputSymbols() == NULL:             # <<<<<<<<<<<<<<
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
*/
  }

  /* "pywrapfst.pyx":2628
 *     if self._mfst.get().MutableOutputSymbols() == NULL:
 *       return
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64_t 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, 2628, __pyx_L1_error)
  }
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFstSymbolTableView(__pyx_v_self->_mfst, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2628, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2620
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 * 
 *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_output_symbols(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("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":2630
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 * 
 *   cpdef int64_t num_states(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_states(self)
*/

static PyObject *__pyx_pw_9pywrapfst_10MutableFst_33num_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int64_t __pyx_f_9pywrapfst_10MutableFst_num_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int __pyx_skip_dispatch) {
  int64_t __pyx_v__states;
  int64_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;
  int64_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_states", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_num_states); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_10MutableFst_33num_states)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2630, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2630, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":2637
 *     """
 *     cdef int64_t _states
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _states = self._mfst.get().NumStates()
 *     return _states
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2638
 *     cdef int64_t _states
 *     with nogil:
 *       _states = self._mfst.get().NumStates()             # <<<<<<<<<<<<<<
 *     return _states
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2638, __pyx_L4_error)
        }
        __pyx_v__states = __pyx_v_self->_mfst.get()->NumStates();
      }

      /* "pywrapfst.pyx":2637
 *     """
 *     cdef int64_t _states
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _states = self._mfst.get().NumStates()
 *     return _states
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2639
 *     with nogil:
 *       _states = self._mfst.get().NumStates()
 *     return _states             # <<<<<<<<<<<<<<
 * 
 *   cdef void _project(self, project_type) except *:
*/
  __pyx_r = __pyx_v__states;
  goto __pyx_L0;

  /* "pywrapfst.pyx":2630
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 * 
 *   cpdef int64_t 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_AddTraceback("pywrapfst.MutableFst.num_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_33num_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_32num_states, "\n    num_states(self)\n\n    Returns the number of states.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_33num_states = {"num_states", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_33num_states, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_32num_states};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_33num_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("num_states (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("num_states", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("num_states", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_32num_states(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_32num_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("num_states", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_10MutableFst_num_states(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2630, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2630, __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.num_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":2641
 *     return _states
 * 
 *   cdef void _project(self, project_type) except *:             # <<<<<<<<<<<<<<
 *     cdef fst.ProjectType _type = _get_project_type(tostring(project_type))
 *     with nogil:
*/

static void __pyx_f_9pywrapfst_10MutableFst__project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type) {
  fst::ProjectType __pyx_v__type;
  std::string __pyx_t_1;
  fst::ProjectType __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":2642
 * 
 *   cdef void _project(self, project_type) except *:
 *     cdef fst.ProjectType _type = _get_project_type(tostring(project_type))             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Project(self._mfst.get(), _type)
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_project_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2642, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_project_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2642, __pyx_L1_error)
  __pyx_v__type = __pyx_t_2;

  /* "pywrapfst.pyx":2643
 *   cdef void _project(self, project_type) except *:
 *     cdef fst.ProjectType _type = _get_project_type(tostring(project_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Project(self._mfst.get(), _type)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2644
 *     cdef fst.ProjectType _type = _get_project_type(tostring(project_type))
 *     with nogil:
 *       fst.Project(self._mfst.get(), _type)             # <<<<<<<<<<<<<<
 * 
 *   def project(self, project_type):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2644, __pyx_L4_error)
        }
        fst::script::Project(__pyx_v_self->_mfst.get(), __pyx_v__type);
      }

      /* "pywrapfst.pyx":2643
 *   cdef void _project(self, project_type) except *:
 *     cdef fst.ProjectType _type = _get_project_type(tostring(project_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Project(self._mfst.get(), _type)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2641
 *     return _states
 * 
 *   cdef void _project(self, project_type) except *:             # <<<<<<<<<<<<<<
 *     cdef fst.ProjectType _type = _get_project_type(tostring(project_type))
 *     with nogil:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._project", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2646
 *       fst.Project(self._mfst.get(), _type)
 * 
 *   def project(self, project_type):             # <<<<<<<<<<<<<<
 *     """
 *     project(self, project_type)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_35project(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_34project, "\n    project(self, project_type)\n\n    Converts the FST to an acceptor using input or output labels.\n\n    This operation destructively projects an FST onto its domain or range by\n    either copying each arc's input label to its output label (the default) or\n    vice versa.\n\n    Args:\n      project_type: A string matching a known projection type; one of:\n          \"input\", \"output\".\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_35project = {"project", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_35project, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_34project};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_35project(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_project_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("project (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_project_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2646, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2646, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "project", 0) < 0) __PYX_ERR(0, 2646, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("project", 1, 1, 1, i); __PYX_ERR(0, 2646, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2646, __pyx_L3_error)
    }
    __pyx_v_project_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("project", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2646, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_34project(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_project_type);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_34project(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_project_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("project", 0);

  /* "pywrapfst.pyx":2663
 *       self.
 *     """
 *     self._project(project_type)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_project");
    __PYX_ERR(0, 2663, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_project(__pyx_v_self, __pyx_v_project_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2663, __pyx_L1_error)

  /* "pywrapfst.pyx":2664
 *     """
 *     self._project(project_type)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _prune(self,
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2646
 *       fst.Project(self._mfst.get(), _type)
 * 
 *   def project(self, project_type):             # <<<<<<<<<<<<<<
 *     """
 *     project(self, project_type)
*/

  /* 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":2666
 *     return self
 * 
 *   cdef void _prune(self,             # <<<<<<<<<<<<<<
 *                    float delta=fst.kDelta,
 *                    int64_t nstate=fst.kNoStateId,
*/

static void __pyx_f_9pywrapfst_10MutableFst__prune(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__prune *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_mstate_global->__pyx_k__9;
  int64_t __pyx_v_nstate = __pyx_mstate_global->__pyx_k__10;

  /* "pywrapfst.pyx":2669
 *                    float delta=fst.kDelta,
 *                    int64_t nstate=fst.kNoStateId,
 *                    weight=None) except *:             # <<<<<<<<<<<<<<
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
*/
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  fst::script::WeightClass __pyx_v__weight;
  std::string __pyx_t_1;
  fst::script::WeightClass __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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":2671
 *                    weight=None) except *:
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                             weight)
 *     with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 2671, __pyx_L1_error)
  }
  __pyx_t_1 = ((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); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2671, __pyx_L1_error)

  /* "pywrapfst.pyx":2672
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Prune(self._mfst.get(), _weight, nstate, delta)
*/
  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_zero(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2671, __pyx_L1_error)
  __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pywrapfst.pyx":2673
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Prune(self._mfst.get(), _weight, nstate, delta)
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2674
 *                                                             weight)
 *     with nogil:
 *       fst.Prune(self._mfst.get(), _weight, nstate, delta)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2674, __pyx_L4_error)
        }
        fst::script::Prune(__pyx_v_self->_mfst.get(), __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta);
      }

      /* "pywrapfst.pyx":2673
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Prune(self._mfst.get(), _weight, nstate, delta)
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2675
 *     with nogil:
 *       fst.Prune(self._mfst.get(), _weight, nstate, delta)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def prune(self,
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2675, __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, 2675, __pyx_L1_error)

  /* "pywrapfst.pyx":2666
 *     return self
 * 
 *   cdef void _prune(self,             # <<<<<<<<<<<<<<
 *                    float delta=fst.kDelta,
 *                    int64_t nstate=fst.kNoStateId,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._prune", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2677
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64_t nstate=fst.kNoStateId,
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_37prune(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_36prune, "\n    prune(self, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)\n\n    Removes paths with weights below a certain threshold.\n\n    This operation deletes states and arcs in the input FST that do not belong\n    to a successful path whose weight is no more (w.r.t the natural semiring\n    order) than the threshold t \\otimes-times the weight of the shortest path in\n    the input FST. Weights must be commutative and have the path property.\n\n    Args:\n      delta: Comparison/quantization delta.\n      nstate: State number threshold.\n      weight: A Weight or weight string indicating the desired weight threshold\n          below which paths are pruned; if omitted, no paths are pruned.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_37prune = {"prune", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_37prune, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_36prune};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_37prune(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  float __pyx_v_delta;
  int64_t __pyx_v_nstate;
  PyObject *__pyx_v_weight = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prune (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_nstate,&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2677, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "prune", 0) < 0) __PYX_ERR(0, 2677, __pyx_L3_error)

      /* "pywrapfst.pyx":2680
 *             float delta=fst.kDelta,
 *             int64_t nstate=fst.kNoStateId,
 *             weight=None):             # <<<<<<<<<<<<<<
 *     """
 *     prune(self, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2677, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    if (values[0]) {
      __pyx_v_delta = __Pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2678, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__11;
    }
    if (values[1]) {
      __pyx_v_nstate = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2679, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_mstate_global->__pyx_k__12;
    }
    __pyx_v_weight = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prune", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 2677, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_36prune(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);

  /* "pywrapfst.pyx":2677
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64_t nstate=fst.kNoStateId,
*/

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_36prune(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, int64_t __pyx_v_nstate, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__prune __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prune", 0);

  /* "pywrapfst.pyx":2700
 *       self.
 *     """
 *     self._prune(delta, nstate, weight)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_prune");
    __PYX_ERR(0, 2700, __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, 2700, __pyx_L1_error)

  /* "pywrapfst.pyx":2701
 *     """
 *     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":2677
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64_t 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":2703
 *     return self
 * 
 *   cdef void _push(self,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kShortestDelta,
 *                   bool remove_total_weight=False,
*/

static void __pyx_f_9pywrapfst_10MutableFst__push(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__push *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_mstate_global->__pyx_k__13;

  /* "pywrapfst.pyx":2705
 *   cdef void _push(self,
 *                   float delta=fst.kShortestDelta,
 *                   bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                   reweight_type="to_initial"):
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
*/
  bool __pyx_v_remove_total_weight = ((bool)0);
  PyObject *__pyx_v_reweight_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial);
  enum fst::ReweightType __pyx_v__type;
  std::string __pyx_t_1;
  enum fst::ReweightType __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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_reweight_type = __pyx_optional_args->reweight_type;
        }
      }
    }
  }

  /* "pywrapfst.pyx":2707
 *                   bool remove_total_weight=False,
 *                   reweight_type="to_initial"):
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_reweight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2707, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_reweight_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2707, __pyx_L1_error)
  __pyx_v__type = __pyx_t_2;

  /* "pywrapfst.pyx":2708
 *                   reweight_type="to_initial"):
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2709
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *     with nogil:
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)             # <<<<<<<<<<<<<<
 * 
 *   def push(self,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2709, __pyx_L4_error)
        }
        fst::script::Push(__pyx_v_self->_mfst.get(), __pyx_v__type, __pyx_v_delta, __pyx_v_remove_total_weight);
      }

      /* "pywrapfst.pyx":2708
 *                   reweight_type="to_initial"):
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2703
 *     return self
 * 
 *   cdef void _push(self,             # <<<<<<<<<<<<<<
 *                   float delta=fst.kShortestDelta,
 *                   bool remove_total_weight=False,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._push", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2711
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_39push(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_38push, "\n    push(self, delta=1-e6, remove_total_weight=False,\n         reweight_type=\"to_initial\")\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      reweight_type: Push towards initial or final states: a string matching a\n          known reweight type: one of \"to_initial\", \"to_final\"\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_39push = {"push", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_39push, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_38push};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_39push(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  float __pyx_v_delta;
  bool __pyx_v_remove_total_weight;
  PyObject *__pyx_v_reweight_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("push (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_remove_total_weight,&__pyx_mstate_global->__pyx_n_u_reweight_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2711, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2711, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2711, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2711, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "push", 0) < 0) __PYX_ERR(0, 2711, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial));
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2711, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2711, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2711, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial));
    }
    if (values[0]) {
      __pyx_v_delta = __Pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2712, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__14;
    }
    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, 2713, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2713
 *   def push(self,
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *            reweight_type="to_initial"):
 *     """
*/
      __pyx_v_remove_total_weight = ((bool)0);
    }
    __pyx_v_reweight_type = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("push", 0, 0, 3, __pyx_nargs); __PYX_ERR(0, 2711, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_38push(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_delta, __pyx_v_remove_total_weight, __pyx_v_reweight_type);

  /* "pywrapfst.pyx":2711
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,
*/

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_38push(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, float __pyx_v_delta, bool __pyx_v_remove_total_weight, PyObject *__pyx_v_reweight_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__push __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("push", 0);

  /* "pywrapfst.pyx":2740
 *       self.
 *     """
 *     self._push(delta, remove_total_weight, reweight_type)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_push");
    __PYX_ERR(0, 2740, __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.reweight_type = __pyx_v_reweight_type;
  ((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, 2740, __pyx_L1_error)

  /* "pywrapfst.pyx":2741
 *     """
 *     self._push(delta, remove_total_weight, reweight_type)
 *     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":2711
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kShortestDelta,
 *            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":2743
 *     return self
 * 
 *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[fst.LabelPair] _ipairs
 *     cdef vector[fst.LabelPair] _opairs
*/

static void __pyx_f_9pywrapfst_10MutableFst__relabel_pairs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args) {
  PyObject *__pyx_v_ipairs = ((PyObject *)Py_None);
  PyObject *__pyx_v_opairs = ((PyObject *)Py_None);
  std::vector<__pyx_t_10cpywrapfst_LabelPair>  __pyx_v__ipairs;
  std::vector<__pyx_t_10cpywrapfst_LabelPair>  __pyx_v__opairs;
  PyObject *__pyx_v_before = NULL;
  PyObject *__pyx_v_after = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int64_t __pyx_t_10;
  int64_t __pyx_t_11;
  __pyx_t_10cpywrapfst_LabelPair __pyx_t_12;
  int __pyx_t_13;
  size_t __pyx_t_14;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_relabel_pairs", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_ipairs = __pyx_optional_args->ipairs;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_opairs = __pyx_optional_args->opairs;
      }
    }
  }

  /* "pywrapfst.pyx":2746
 *     cdef vector[fst.LabelPair] _ipairs
 *     cdef vector[fst.LabelPair] _opairs
 *     if ipairs:             # <<<<<<<<<<<<<<
 *       for before, after in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ipairs); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2746, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2747
 *     cdef vector[fst.LabelPair] _opairs
 *     if ipairs:
 *       for before, after in ipairs:             # <<<<<<<<<<<<<<
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:
*/
    if (likely(PyList_CheckExact(__pyx_v_ipairs)) || PyTuple_CheckExact(__pyx_v_ipairs)) {
      __pyx_t_2 = __pyx_v_ipairs; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_ipairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2747, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2747, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2747, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2747, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 2747, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
          __Pyx_INCREF(__pyx_t_6);
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_7);
        } else {
          __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2747, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2747, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_7);
        }
        #else
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
        index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2747, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2747, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_before, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_after, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "pywrapfst.pyx":2748
 *     if ipairs:
 *       for before, after in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))             # <<<<<<<<<<<<<<
 *     if opairs:
 *       for before, after in opairs:
*/
      __pyx_t_10 = __Pyx_PyLong_As_int64_t(__pyx_v_before); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L1_error)
      __pyx_t_11 = __Pyx_PyLong_As_int64_t(__pyx_v_after); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2748, __pyx_L1_error)
      try {
        __pyx_t_12 = __pyx_t_10cpywrapfst_LabelPair(__pyx_t_10, __pyx_t_11);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2748, __pyx_L1_error)
      }
      try {
        __pyx_v__ipairs.push_back(__pyx_t_12);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2748, __pyx_L1_error)
      }

      /* "pywrapfst.pyx":2747
 *     cdef vector[fst.LabelPair] _opairs
 *     if ipairs:
 *       for before, after in ipairs:             # <<<<<<<<<<<<<<
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pywrapfst.pyx":2746
 *     cdef vector[fst.LabelPair] _ipairs
 *     cdef vector[fst.LabelPair] _opairs
 *     if ipairs:             # <<<<<<<<<<<<<<
 *       for before, after in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))
*/
  }

  /* "pywrapfst.pyx":2749
 *       for before, after in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:             # <<<<<<<<<<<<<<
 *       for before, after in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))
*/
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_opairs); if (unlikely((__pyx_t_1 < 0))) __PYX_ERR(0, 2749, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2750
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:
 *       for before, after in opairs:             # <<<<<<<<<<<<<<
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():
*/
    if (likely(PyList_CheckExact(__pyx_v_opairs)) || PyTuple_CheckExact(__pyx_v_opairs)) {
      __pyx_t_2 = __pyx_v_opairs; __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      __pyx_t_4 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_opairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2750, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2750, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_4)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2750, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
          ++__pyx_t_3;
        } else {
          {
            Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
            #if !CYTHON_ASSUME_SAFE_SIZE
            if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2750, __pyx_L1_error)
            #endif
            if (__pyx_t_3 >= __pyx_temp) break;
          }
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
          #else
          __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
          #endif
          ++__pyx_t_3;
        }
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2750, __pyx_L1_error)
      } else {
        __pyx_t_5 = __pyx_t_4(__pyx_t_2);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2750, __pyx_L1_error)
            PyErr_Clear();
          }
          break;
        }
      }
      __Pyx_GOTREF(__pyx_t_5);
      if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
        PyObject* sequence = __pyx_t_5;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 2750, __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_INCREF(__pyx_t_7);
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
          __Pyx_INCREF(__pyx_t_6);
        } else {
          __pyx_t_7 = __Pyx_PyList_GetItemRef(sequence, 0);
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2750, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1);
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2750, __pyx_L1_error)
          __Pyx_XGOTREF(__pyx_t_6);
        }
        #else
        __pyx_t_7 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2750, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2750, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2750, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_9 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_8);
        index = 0; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L12_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 2750, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L13_unpacking_done;
        __pyx_L12_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 2750, __pyx_L1_error)
        __pyx_L13_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_before, __pyx_t_7);
      __pyx_t_7 = 0;
      __Pyx_XDECREF_SET(__pyx_v_after, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "pywrapfst.pyx":2751
 *     if opairs:
 *       for before, after in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))             # <<<<<<<<<<<<<<
 *     if _ipairs.empty() and _opairs.empty():
 *       raise FstArgError("No relabeling pairs specified")
*/
      __pyx_t_11 = __Pyx_PyLong_As_int64_t(__pyx_v_before); if (unlikely((__pyx_t_11 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2751, __pyx_L1_error)
      __pyx_t_10 = __Pyx_PyLong_As_int64_t(__pyx_v_after); if (unlikely((__pyx_t_10 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2751, __pyx_L1_error)
      try {
        __pyx_t_12 = __pyx_t_10cpywrapfst_LabelPair(__pyx_t_11, __pyx_t_10);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2751, __pyx_L1_error)
      }
      try {
        __pyx_v__opairs.push_back(__pyx_t_12);
      } catch(...) {
        __Pyx_CppExn2PyErr();
        __PYX_ERR(0, 2751, __pyx_L1_error)
      }

      /* "pywrapfst.pyx":2750
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:
 *       for before, after in opairs:             # <<<<<<<<<<<<<<
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():
*/
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pywrapfst.pyx":2749
 *       for before, after in ipairs:
 *         _ipairs.push_back(fst.LabelPair(before, after))
 *     if opairs:             # <<<<<<<<<<<<<<
 *       for before, after in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))
*/
  }

  /* "pywrapfst.pyx":2752
 *       for before, after in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():             # <<<<<<<<<<<<<<
 *       raise FstArgError("No relabeling pairs specified")
 *     with nogil:
*/
  __pyx_t_13 = __pyx_v__ipairs.empty();
  if (__pyx_t_13) {
  } else {
    __pyx_t_1 = __pyx_t_13;
    goto __pyx_L16_bool_binop_done;
  }
  __pyx_t_13 = __pyx_v__opairs.empty();
  __pyx_t_1 = __pyx_t_13;
  __pyx_L16_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":2753
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():
 *       raise FstArgError("No relabeling pairs specified")             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Relabel(self._mfst.get(), _ipairs, _opairs)
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_14 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_14 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_mstate_global->__pyx_kp_u_No_relabeling_pairs_specified};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_14, (2-__pyx_t_14) | (__pyx_t_14*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2753, __pyx_L1_error)

    /* "pywrapfst.pyx":2752
 *       for before, after in opairs:
 *         _opairs.push_back(fst.LabelPair(before, after))
 *     if _ipairs.empty() and _opairs.empty():             # <<<<<<<<<<<<<<
 *       raise FstArgError("No relabeling pairs specified")
 *     with nogil:
*/
  }

  /* "pywrapfst.pyx":2754
 *     if _ipairs.empty() and _opairs.empty():
 *       raise FstArgError("No relabeling pairs specified")
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Relabel(self._mfst.get(), _ipairs, _opairs)
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2755
 *       raise FstArgError("No relabeling pairs specified")
 *     with nogil:
 *       fst.Relabel(self._mfst.get(), _ipairs, _opairs)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2755, __pyx_L19_error)
        }
        fst::script::Relabel(__pyx_v_self->_mfst.get(), __pyx_v__ipairs, __pyx_v__opairs);
      }

      /* "pywrapfst.pyx":2754
 *     if _ipairs.empty() and _opairs.empty():
 *       raise FstArgError("No relabeling pairs specified")
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Relabel(self._mfst.get(), _ipairs, _opairs)
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L20;
        }
        __pyx_L19_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L20:;
      }
  }

  /* "pywrapfst.pyx":2756
 *     with nogil:
 *       fst.Relabel(self._mfst.get(), _ipairs, _opairs)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def relabel_pairs(self, ipairs=None, opairs=None):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2756, __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, 2756, __pyx_L1_error)

  /* "pywrapfst.pyx":2743
 *     return self
 * 
 *   cdef void _relabel_pairs(self, ipairs=None, opairs=None) except *:             # <<<<<<<<<<<<<<
 *     cdef vector[fst.LabelPair] _ipairs
 *     cdef vector[fst.LabelPair] _opairs
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("pywrapfst.MutableFst._relabel_pairs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_before);
  __Pyx_XDECREF(__pyx_v_after);
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":2758
 *     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_10MutableFst_41relabel_pairs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_40relabel_pairs, "\n    relabel_pairs(self, ipairs=None, opairs=None)\n\n    Replaces input and/or output labels using pairs of labels.\n\n    This operation destructively relabels the input and/or output labels of the\n    FST using pairs of the form (old_ID, new_ID); omitted indices are\n    identity-mapped.\n\n    Args:\n      ipairs: An iterable containing (older index, newer index) integer pairs.\n      opairs: An iterable containing (older index, newer index) integer pairs.\n\n    Returns:\n      self.\n\n    Raises:\n      FstArgError: No relabeling pairs specified.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_41relabel_pairs = {"relabel_pairs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_41relabel_pairs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_40relabel_pairs};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_41relabel_pairs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_ipairs = 0;
  PyObject *__pyx_v_opairs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("relabel_pairs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ipairs,&__pyx_mstate_global->__pyx_n_u_opairs,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2758, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2758, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2758, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "relabel_pairs", 0) < 0) __PYX_ERR(0, 2758, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2758, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2758, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_ipairs = values[0];
    __pyx_v_opairs = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("relabel_pairs", 0, 0, 2, __pyx_nargs); __PYX_ERR(0, 2758, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_40relabel_pairs(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_ipairs, __pyx_v_opairs);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_40relabel_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_10MutableFst__relabel_pairs __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relabel_pairs", 0);

  /* "pywrapfst.pyx":2778
 *       FstArgError: No relabeling pairs specified.
 *     """
 *     self._relabel_pairs(ipairs, opairs)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_pairs");
    __PYX_ERR(0, 2778, __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, 2778, __pyx_L1_error)

  /* "pywrapfst.pyx":2779
 *     """
 *     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":2758
 *     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":2781
 *     return self
 * 
 *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
 *                             SymbolTableView old_isymbols=None,
 *                             SymbolTableView new_isymbols=None,
*/

static void __pyx_f_9pywrapfst_10MutableFst__relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args) {

  /* "pywrapfst.pyx":2782
 * 
 *   cdef void _relabel_tables(self,
 *                             SymbolTableView old_isymbols=None,             # <<<<<<<<<<<<<<
 *                             SymbolTableView new_isymbols=None,
 *                             unknown_isymbol="",
*/
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);

  /* "pywrapfst.pyx":2783
 *   cdef void _relabel_tables(self,
 *                             SymbolTableView old_isymbols=None,
 *                             SymbolTableView new_isymbols=None,             # <<<<<<<<<<<<<<
 *                             unknown_isymbol="",
 *                             bool attach_new_isymbols=True,
*/
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
  PyObject *__pyx_v_unknown_isymbol = ((PyObject *)__pyx_mstate_global->__pyx_kp_u__6);

  /* "pywrapfst.pyx":2785
 *                             SymbolTableView new_isymbols=None,
 *                             unknown_isymbol="",
 *                             bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
 *                             SymbolTableView old_osymbols=None,
 *                             SymbolTableView new_osymbols=None,
*/
  bool __pyx_v_attach_new_isymbols = ((bool)1);

  /* "pywrapfst.pyx":2786
 *                             unknown_isymbol="",
 *                             bool attach_new_isymbols=True,
 *                             SymbolTableView old_osymbols=None,             # <<<<<<<<<<<<<<
 *                             SymbolTableView new_osymbols=None,
 *                             unknown_osymbol="",
*/
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);

  /* "pywrapfst.pyx":2787
 *                             bool attach_new_isymbols=True,
 *                             SymbolTableView old_osymbols=None,
 *                             SymbolTableView new_osymbols=None,             # <<<<<<<<<<<<<<
 *                             unknown_osymbol="",
 *                             bool attach_new_osymbols=True) except *:
*/
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None);
  PyObject *__pyx_v_unknown_osymbol = ((PyObject *)__pyx_mstate_global->__pyx_kp_u__6);

  /* "pywrapfst.pyx":2789
 *                             SymbolTableView new_osymbols=None,
 *                             unknown_osymbol="",
 *                             bool attach_new_osymbols=True) except *:             # <<<<<<<<<<<<<<
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")
*/
  bool __pyx_v_attach_new_osymbols = ((bool)1);
  fst::SymbolTable const *__pyx_v__old_isymbols;
  fst::SymbolTable const *__pyx_v__old_osymbols;
  fst::SymbolTable const *__pyx_v__new_isymbols;
  fst::SymbolTable const *__pyx_v__new_osymbols;
  std::string __pyx_v__unknown_isymbol;
  std::string __pyx_v__unknown_osymbol;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  fst::SymbolTable const *__pyx_t_7;
  std::string __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_relabel_tables", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_old_isymbols = __pyx_optional_args->old_isymbols;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_new_isymbols = __pyx_optional_args->new_isymbols;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_unknown_isymbol = __pyx_optional_args->unknown_isymbol;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_attach_new_isymbols = __pyx_optional_args->attach_new_isymbols;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_old_osymbols = __pyx_optional_args->old_osymbols;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_new_osymbols = __pyx_optional_args->new_osymbols;
                if (__pyx_optional_args->__pyx_n > 6) {
                  __pyx_v_unknown_osymbol = __pyx_optional_args->unknown_osymbol;
                  if (__pyx_optional_args->__pyx_n > 7) {
                    __pyx_v_attach_new_osymbols = __pyx_optional_args->attach_new_osymbols;
                  }
                }
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":2790
 *                             unknown_osymbol="",
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:             # <<<<<<<<<<<<<<
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_new_isymbols) == Py_None);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (((PyObject *)__pyx_v_new_osymbols) == Py_None);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":2791
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 *     if old_isymbols is not None:
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_No_new_SymbolTables_specified};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2791, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2791, __pyx_L1_error)

    /* "pywrapfst.pyx":2790
 *                             unknown_osymbol="",
 *                             bool attach_new_osymbols=True) except *:
 *     if new_isymbols is None and new_osymbols is None:             # <<<<<<<<<<<<<<
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
*/
  }

  /* "pywrapfst.pyx":2792
 *     if new_isymbols is None and new_osymbols is None:
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()             # <<<<<<<<<<<<<<
 *     if old_isymbols is not None:
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2792, __pyx_L1_error)
  }
  __pyx_v__old_isymbols = __pyx_v_self->__pyx_base._fst.get()->InputSymbols();

  /* "pywrapfst.pyx":2793
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 *     if old_isymbols is not None:             # <<<<<<<<<<<<<<
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_old_isymbols) != Py_None);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2794
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 *     if old_isymbols is not None:
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 *     if old_osymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_old_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2794, __pyx_L1_error)
    }
    __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_old_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2794, __pyx_L1_error)
    __pyx_v__old_isymbols = __pyx_t_7;

    /* "pywrapfst.pyx":2793
 *       raise FstArgError("No new SymbolTables specified")
 *     cdef const fst.SymbolTable *_old_isymbols = self._fst.get().InputSymbols()
 *     if old_isymbols is not None:             # <<<<<<<<<<<<<<
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
*/
  }

  /* "pywrapfst.pyx":2795
 *     if old_isymbols is not None:
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()             # <<<<<<<<<<<<<<
 *     if old_osymbols is not None:
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 2795, __pyx_L1_error)
  }
  __pyx_v__old_osymbols = __pyx_v_self->__pyx_base._fst.get()->OutputSymbols();

  /* "pywrapfst.pyx":2796
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 *     if old_osymbols is not None:             # <<<<<<<<<<<<<<
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_old_osymbols) != Py_None);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2797
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 *     if old_osymbols is not None:
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 *     if new_isymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_old_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2797, __pyx_L1_error)
    }
    __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_old_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_old_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2797, __pyx_L1_error)
    __pyx_v__old_osymbols = __pyx_t_7;

    /* "pywrapfst.pyx":2796
 *       _old_isymbols = old_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_old_osymbols = self._fst.get().OutputSymbols()
 *     if old_osymbols is not None:             # <<<<<<<<<<<<<<
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
*/
  }

  /* "pywrapfst.pyx":2798
 *     if old_osymbols is not None:
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL             # <<<<<<<<<<<<<<
 *     if new_isymbols is not None:
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
*/
  __pyx_v__new_isymbols = NULL;

  /* "pywrapfst.pyx":2799
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 *     if new_isymbols is not None:             # <<<<<<<<<<<<<<
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_new_isymbols) != Py_None);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2800
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 *     if new_isymbols is not None:
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 *     if new_osymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_new_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2800, __pyx_L1_error)
    }
    __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_new_isymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_isymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2800, __pyx_L1_error)
    __pyx_v__new_isymbols = __pyx_t_7;

    /* "pywrapfst.pyx":2799
 *        _old_osymbols = old_osymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_isymbols = NULL
 *     if new_isymbols is not None:             # <<<<<<<<<<<<<<
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
*/
  }

  /* "pywrapfst.pyx":2801
 *     if new_isymbols is not None:
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL             # <<<<<<<<<<<<<<
 *     if new_osymbols is not None:
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
*/
  __pyx_v__new_osymbols = NULL;

  /* "pywrapfst.pyx":2802
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 *     if new_osymbols is not None:             # <<<<<<<<<<<<<<
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 *     cdef string _unknown_isymbol = tostring(unknown_isymbol)
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_new_osymbols) != Py_None);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":2803
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 *     if new_osymbols is not None:
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     cdef string _unknown_isymbol = tostring(unknown_isymbol)
 *     cdef string _unknown_osymbol = tostring(unknown_osymbol)
*/
    if (unlikely(((PyObject *)__pyx_v_new_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 2803, __pyx_L1_error)
    }
    __pyx_t_7 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_new_osymbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_new_osymbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2803, __pyx_L1_error)
    __pyx_v__new_osymbols = __pyx_t_7;

    /* "pywrapfst.pyx":2802
 *       _new_isymbols = new_isymbols._raw_ptr_or_raise()
 *     cdef const fst.SymbolTable *_new_osymbols = NULL
 *     if new_osymbols is not None:             # <<<<<<<<<<<<<<
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 *     cdef string _unknown_isymbol = tostring(unknown_isymbol)
*/
  }

  /* "pywrapfst.pyx":2804
 *     if new_osymbols is not None:
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 *     cdef string _unknown_isymbol = tostring(unknown_isymbol)             # <<<<<<<<<<<<<<
 *     cdef string _unknown_osymbol = tostring(unknown_osymbol)
 *     with nogil:
*/
  __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_isymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2804, __pyx_L1_error)
  __pyx_v__unknown_isymbol = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

  /* "pywrapfst.pyx":2805
 *       _new_osymbols = new_osymbols._raw_ptr_or_raise()
 *     cdef string _unknown_isymbol = tostring(unknown_isymbol)
 *     cdef string _unknown_osymbol = tostring(unknown_osymbol)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Relabel(self._mfst.get(),
*/
  __pyx_t_8 = __pyx_f_9pywrapfst_tostring(__pyx_v_unknown_osymbol); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2805, __pyx_L1_error)
  __pyx_v__unknown_osymbol = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_8);

  /* "pywrapfst.pyx":2806
 *     cdef string _unknown_isymbol = tostring(unknown_isymbol)
 *     cdef string _unknown_osymbol = tostring(unknown_osymbol)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Relabel(self._mfst.get(),
 *           _old_isymbols,
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2807
 *     cdef string _unknown_osymbol = tostring(unknown_osymbol)
 *     with nogil:
 *       fst.Relabel(self._mfst.get(),             # <<<<<<<<<<<<<<
 *           _old_isymbols,
 *           _new_isymbols,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2807, __pyx_L11_error)
        }

        /* "pywrapfst.pyx":2815
 *           _new_osymbols,
 *           _unknown_osymbol,
 *           attach_new_osymbols)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        fst::script::Relabel(__pyx_v_self->_mfst.get(), __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":2806
 *     cdef string _unknown_isymbol = tostring(unknown_isymbol)
 *     cdef string _unknown_osymbol = tostring(unknown_osymbol)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Relabel(self._mfst.get(),
 *           _old_isymbols,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L12;
        }
        __pyx_L11_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L12:;
      }
  }

  /* "pywrapfst.pyx":2816
 *           _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, 2816, __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, 2816, __pyx_L1_error)

  /* "pywrapfst.pyx":2781
 *     return self
 * 
 *   cdef void _relabel_tables(self,             # <<<<<<<<<<<<<<
 *                             SymbolTableView old_isymbols=None,
 *                             SymbolTableView new_isymbols=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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":2818
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_43relabel_tables(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_42relabel_tables, "\n    relabel_tables(self, old_isymbols=None, new_isymbols=None,\n                   unknown_isymbol=\"\", attach_new_isymbols=True,\n                   old_osymbols=None, new_osymbols=None,\n                   unknown_osymbol=\"\", attach_new_osymbols=True)\n\n    Replaces input and/or output labels using SymbolTables.\n\n    This operation destructively relabels the input and/or output labels of the\n    FST using user-specified symbol tables; omitted symbols are identity-mapped.\n\n    Args:\n       old_isymbols: The old SymbolTable for input labels, defaulting to the\n          FST's input symbol table.\n       new_isymbols: A SymbolTable used to relabel the input labels\n       unknown_isymbol: Input symbol to use to relabel OOVs (if empty,\n          OOVs raise an exception)\n       attach_new_isymbols: Should new_isymbols be made the FST's input symbol\n          table?\n       old_osymbols: The old SymbolTable for output labels, defaulting to the\n          FST's output symbol table.\n       new_osymbols: A SymbolTable used to relabel the output labels.\n       unknown_osymbol: Outnput symbol to use to relabel OOVs (if empty,\n          OOVs raise an exception)\n       attach_new_isymbols: Should new_osymbols be made the FST's output symbol\n          table?\n\n    Returns:\n      self.\n\n    Raises:\n      FstArgError: No SymbolTable specified.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_43relabel_tables = {"relabel_tables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_43relabel_tables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_42relabel_tables};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_43relabel_tables(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols = 0;
  PyObject *__pyx_v_unknown_isymbol = 0;
  bool __pyx_v_attach_new_isymbols;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols = 0;
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols = 0;
  PyObject *__pyx_v_unknown_osymbol = 0;
  bool __pyx_v_attach_new_osymbols;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[8] = {0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("relabel_tables (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_old_isymbols,&__pyx_mstate_global->__pyx_n_u_new_isymbols,&__pyx_mstate_global->__pyx_n_u_unknown_isymbol,&__pyx_mstate_global->__pyx_n_u_attach_new_isymbols,&__pyx_mstate_global->__pyx_n_u_old_osymbols,&__pyx_mstate_global->__pyx_n_u_new_osymbols,&__pyx_mstate_global->__pyx_n_u_unknown_osymbol,&__pyx_mstate_global->__pyx_n_u_attach_new_osymbols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2818, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "relabel_tables", 0) < 0) __PYX_ERR(0, 2818, __pyx_L3_error)

      /* "pywrapfst.pyx":2819
 * 
 *   def relabel_tables(self,
 *                      SymbolTableView old_isymbols=None,             # <<<<<<<<<<<<<<
 *                      SymbolTableView new_isymbols=None,
 *                      unknown_isymbol="",
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":2820
 *   def relabel_tables(self,
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,             # <<<<<<<<<<<<<<
 *                      unknown_isymbol="",
 *                      bool attach_new_isymbols=True,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));

      /* "pywrapfst.pyx":2823
 *                      unknown_isymbol="",
 *                      bool attach_new_isymbols=True,
 *                      SymbolTableView old_osymbols=None,             # <<<<<<<<<<<<<<
 *                      SymbolTableView new_osymbols=None,
 *                      unknown_osymbol="",
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":2824
 *                      bool attach_new_isymbols=True,
 *                      SymbolTableView old_osymbols=None,
 *                      SymbolTableView new_osymbols=None,             # <<<<<<<<<<<<<<
 *                      unknown_osymbol="",
 *                      bool attach_new_osymbols=True):
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));
    } else {
      switch (__pyx_nargs) {
        case  8:
        values[7] = __Pyx_ArgRef_FASTCALL(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2818, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }

      /* "pywrapfst.pyx":2819
 * 
 *   def relabel_tables(self,
 *                      SymbolTableView old_isymbols=None,             # <<<<<<<<<<<<<<
 *                      SymbolTableView new_isymbols=None,
 *                      unknown_isymbol="",
*/
      if (!values[0]) values[0] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":2820
 *   def relabel_tables(self,
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,             # <<<<<<<<<<<<<<
 *                      unknown_isymbol="",
 *                      bool attach_new_isymbols=True,
*/
      if (!values[1]) values[1] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));

      /* "pywrapfst.pyx":2823
 *                      unknown_isymbol="",
 *                      bool attach_new_isymbols=True,
 *                      SymbolTableView old_osymbols=None,             # <<<<<<<<<<<<<<
 *                      SymbolTableView new_osymbols=None,
 *                      unknown_osymbol="",
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));

      /* "pywrapfst.pyx":2824
 *                      bool attach_new_isymbols=True,
 *                      SymbolTableView old_osymbols=None,
 *                      SymbolTableView new_osymbols=None,             # <<<<<<<<<<<<<<
 *                      unknown_osymbol="",
 *                      bool attach_new_osymbols=True):
*/
      if (!values[5]) values[5] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));
    }
    __pyx_v_old_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
    __pyx_v_new_isymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[1]);
    __pyx_v_unknown_isymbol = values[2];
    if (values[3]) {
      __pyx_v_attach_new_isymbols = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_attach_new_isymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2822, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2822
 *                      SymbolTableView new_isymbols=None,
 *                      unknown_isymbol="",
 *                      bool attach_new_isymbols=True,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_osymbols=None,
 *                      SymbolTableView new_osymbols=None,
*/
      __pyx_v_attach_new_isymbols = ((bool)1);
    }
    __pyx_v_old_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[4]);
    __pyx_v_new_osymbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[5]);
    __pyx_v_unknown_osymbol = values[6];
    if (values[7]) {
      __pyx_v_attach_new_osymbols = __Pyx_PyObject_IsTrue(values[7]); if (unlikely((__pyx_v_attach_new_osymbols == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2826, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2826
 *                      SymbolTableView new_osymbols=None,
 *                      unknown_osymbol="",
 *                      bool attach_new_osymbols=True):             # <<<<<<<<<<<<<<
 *     """
 *     relabel_tables(self, old_isymbols=None, new_isymbols=None,
*/
      __pyx_v_attach_new_osymbols = ((bool)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("relabel_tables", 0, 0, 8, __pyx_nargs); __PYX_ERR(0, 2818, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "old_isymbols", 0))) __PYX_ERR(0, 2819, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_isymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "new_isymbols", 0))) __PYX_ERR(0, 2820, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_osymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "old_osymbols", 0))) __PYX_ERR(0, 2823, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_osymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "new_osymbols", 0))) __PYX_ERR(0, 2824, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_42relabel_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":2818
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_42relabel_tables(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_isymbols, PyObject *__pyx_v_unknown_isymbol, bool __pyx_v_attach_new_isymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_old_osymbols, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_new_osymbols, PyObject *__pyx_v_unknown_osymbol, bool __pyx_v_attach_new_osymbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("relabel_tables", 0);

  /* "pywrapfst.pyx":2860
 *       FstArgError: No SymbolTable specified.
 *     """
 *     self._relabel_tables(old_isymbols,             # <<<<<<<<<<<<<<
 *                          new_isymbols,
 *                          unknown_isymbol,
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_relabel_tables");
    __PYX_ERR(0, 2860, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":2867
 *                          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, 2860, __pyx_L1_error)

  /* "pywrapfst.pyx":2868
 *                          unknown_osymbol,
 *                          attach_new_osymbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _reserve_arcs(self, int64_t 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":2818
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView 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":2870
 *     return self
 * 
 *   cdef void _reserve_arcs(self, int64_t state, size_t n) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

static void __pyx_f_9pywrapfst_10MutableFst__reserve_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, size_t __pyx_v_n) {
  bool __pyx_v__result;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reserve_arcs", 0);

  /* "pywrapfst.pyx":2872
 *   cdef void _reserve_arcs(self, int64_t state, size_t n) except *:
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._mfst.get().ReserveArcs(state, n)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2873
 *     cdef bool _result
 *     with nogil:
 *       _result = self._mfst.get().ReserveArcs(state, n)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIndexError("State index out of range")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2873, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_self->_mfst.get()->ReserveArcs(__pyx_v_state, __pyx_v_n);
      }

      /* "pywrapfst.pyx":2872
 *   cdef void _reserve_arcs(self, int64_t state, size_t n) except *:
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._mfst.get().ReserveArcs(state, n)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2874
 *     with nogil:
 *       _result = self._mfst.get().ReserveArcs(state, n)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()
*/
  __pyx_t_1 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":2875
 *       _result = self._mfst.get().ReserveArcs(state, n)
 *     if not _result:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 2875, __pyx_L1_error)

    /* "pywrapfst.pyx":2874
 *     with nogil:
 *       _result = self._mfst.get().ReserveArcs(state, n)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()
*/
  }

  /* "pywrapfst.pyx":2876
 *     if not _result:
 *       raise FstIndexError("State index out of range")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def reserve_arcs(self, int64_t 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, 2876, __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, 2876, __pyx_L1_error)

  /* "pywrapfst.pyx":2870
 *     return self
 * 
 *   cdef void _reserve_arcs(self, int64_t state, size_t n) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

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

/* "pywrapfst.pyx":2878
 *     self._check_mutating_imethod()
 * 
 *   def reserve_arcs(self, int64_t state, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_arcs(self, state, n)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_45reserve_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_44reserve_arcs, "\n    reserve_arcs(self, state, n)\n\n    Reserve n arcs at a particular state (best effort).\n\n    Args:\n      state: The integer index of a state.\n      n: The number of arcs to reserve.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_45reserve_arcs = {"reserve_arcs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_45reserve_arcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_44reserve_arcs};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_45reserve_arcs(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  size_t __pyx_v_n;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reserve_arcs (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2878, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2878, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reserve_arcs", 0) < 0) __PYX_ERR(0, 2878, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, i); __PYX_ERR(0, 2878, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2878, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2878, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2878, __pyx_L3_error)
    __pyx_v_n = __Pyx_PyLong_As_size_t(values[1]); if (unlikely((__pyx_v_n == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 2878, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reserve_arcs", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 2878, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_44reserve_arcs(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_n);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_44reserve_arcs(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, size_t __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reserve_arcs", 0);

  /* "pywrapfst.pyx":2894
 *       FstIndexError: State index out of range.
 *     """
 *     self._reserve_arcs(state, n)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reserve_arcs");
    __PYX_ERR(0, 2894, __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, 2894, __pyx_L1_error)

  /* "pywrapfst.pyx":2895
 *     """
 *     self._reserve_arcs(state, n)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _reserve_states(self, int64_t n):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2878
 *     self._check_mutating_imethod()
 * 
 *   def reserve_arcs(self, int64_t 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":2897
 *     return self
 * 
 *   cdef void _reserve_states(self, int64_t n):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       self._mfst.get().ReserveStates(n)
*/

static void __pyx_f_9pywrapfst_10MutableFst__reserve_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_n) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":2898
 * 
 *   cdef void _reserve_states(self, int64_t n):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mfst.get().ReserveStates(n)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2899
 *   cdef void _reserve_states(self, int64_t n):
 *     with nogil:
 *       self._mfst.get().ReserveStates(n)             # <<<<<<<<<<<<<<
 * 
 *   def reserve_states(self, int64_t n):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2899, __pyx_L4_error)
        }
        __pyx_v_self->_mfst.get()->ReserveStates(__pyx_v_n);
      }

      /* "pywrapfst.pyx":2898
 * 
 *   cdef void _reserve_states(self, int64_t n):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mfst.get().ReserveStates(n)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2897
 *     return self
 * 
 *   cdef void _reserve_states(self, int64_t n):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       self._mfst.get().ReserveStates(n)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._reserve_states", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":2901
 *       self._mfst.get().ReserveStates(n)
 * 
 *   def reserve_states(self, int64_t n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_states(self, n)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_47reserve_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_46reserve_states, "\n    reserve_states(self, n)\n\n    Reserve n states (best effort).\n\n    Args:\n      n: The number of states to reserve.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_47reserve_states = {"reserve_states", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_47reserve_states, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_46reserve_states};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_47reserve_states(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_n;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reserve_states (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_n,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2901, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2901, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reserve_states", 0) < 0) __PYX_ERR(0, 2901, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reserve_states", 1, 1, 1, i); __PYX_ERR(0, 2901, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2901, __pyx_L3_error)
    }
    __pyx_v_n = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_n == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2901, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reserve_states", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 2901, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_46reserve_states(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_n);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_46reserve_states(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reserve_states", 0);

  /* "pywrapfst.pyx":2913
 *       self.
 *     """
 *     self._reserve_states(n)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reserve_states");
    __PYX_ERR(0, 2913, __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, 2913, __pyx_L1_error)

  /* "pywrapfst.pyx":2914
 *     """
 *     self._reserve_states(n)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _reweight(self, potentials, reweight_type="to_initial") except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":2901
 *       self._mfst.get().ReserveStates(n)
 * 
 *   def reserve_states(self, int64_t 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":2916
 *     return self
 * 
 *   cdef void _reweight(self, potentials, reweight_type="to_initial") except *:             # <<<<<<<<<<<<<<
 *     cdef string _weight_type = self.weight_type()
 *     cdef vector[fst.WeightClass] _potentials
*/

static void __pyx_f_9pywrapfst_10MutableFst__reweight(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight *__pyx_optional_args) {
  PyObject *__pyx_v_reweight_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial);
  std::string __pyx_v__weight_type;
  std::vector<fst::script::WeightClass>  __pyx_v__potentials;
  PyObject *__pyx_v_weight = NULL;
  enum fst::ReweightType __pyx_v__type;
  __Pyx_RefNannyDeclarations
  std::string __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;
  enum fst::ReweightType __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_reweight", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_reweight_type = __pyx_optional_args->reweight_type;
    }
  }

  /* "pywrapfst.pyx":2917
 * 
 *   cdef void _reweight(self, potentials, reweight_type="to_initial") except *:
 *     cdef string _weight_type = self.weight_type()             # <<<<<<<<<<<<<<
 *     cdef vector[fst.WeightClass] _potentials
 *     for weight in potentials:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 2917, __pyx_L1_error)
  }
  __pyx_t_1 = ((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); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2917, __pyx_L1_error)
  __pyx_v__weight_type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":2919
 *     cdef string _weight_type = self.weight_type()
 *     cdef vector[fst.WeightClass] _potentials
 *     for weight in potentials:             # <<<<<<<<<<<<<<
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
*/
  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, 2919, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2919, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2919, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        __pyx_t_5 = __Pyx_PyList_GetItemRef(__pyx_t_2, __pyx_t_3);
        ++__pyx_t_3;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 2919, __pyx_L1_error)
          #endif
          if (__pyx_t_3 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
        #else
        __pyx_t_5 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
        #endif
        ++__pyx_t_3;
      }
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2919, __pyx_L1_error)
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 2919, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_XDECREF_SET(__pyx_v_weight, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "pywrapfst.pyx":2920
 *     cdef vector[fst.WeightClass] _potentials
 *     for weight in potentials:
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))             # <<<<<<<<<<<<<<
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *     with nogil:
*/
    __pyx_t_6 = __pyx_f_9pywrapfst__get_WeightClass_or_one(__pyx_v__weight_type, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2920, __pyx_L1_error)
    try {
      __pyx_v__potentials.push_back(__pyx_t_6);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 2920, __pyx_L1_error)
    }

    /* "pywrapfst.pyx":2919
 *     cdef string _weight_type = self.weight_type()
 *     cdef vector[fst.WeightClass] _potentials
 *     for weight in potentials:             # <<<<<<<<<<<<<<
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
*/
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":2921
 *     for weight in potentials:
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Reweight(self._mfst.get(), _potentials, _type)
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_reweight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2921, __pyx_L1_error)
  __pyx_t_7 = __pyx_f_9pywrapfst__get_reweight_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2921, __pyx_L1_error)
  __pyx_v__type = __pyx_t_7;

  /* "pywrapfst.pyx":2922
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Reweight(self._mfst.get(), _potentials, _type)
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2923
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *     with nogil:
 *       fst.Reweight(self._mfst.get(), _potentials, _type)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2923, __pyx_L7_error)
        }
        fst::script::Reweight(__pyx_v_self->_mfst.get(), __pyx_v__potentials, __pyx_v__type);
      }

      /* "pywrapfst.pyx":2922
 *       _potentials.push_back(_get_WeightClass_or_one(_weight_type, weight))
 *     cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Reweight(self._mfst.get(), _potentials, _type)
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pywrapfst.pyx":2924
 *     with nogil:
 *       fst.Reweight(self._mfst.get(), _potentials, _type)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def reweight(self, potentials, reweight_type="to_initial"):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 2924, __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, 2924, __pyx_L1_error)

  /* "pywrapfst.pyx":2916
 *     return self
 * 
 *   cdef void _reweight(self, potentials, reweight_type="to_initial") except *:             # <<<<<<<<<<<<<<
 *     cdef string _weight_type = self.weight_type()
 *     cdef vector[fst.WeightClass] _potentials
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_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":2926
 *     self._check_mutating_imethod()
 * 
 *   def reweight(self, potentials, reweight_type="to_initial"):             # <<<<<<<<<<<<<<
 *     """
 *     reweight(self, potentials, reweight_type="to_initial")
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_49reweight(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_48reweight, "\n    reweight(self, potentials, reweight_type=\"to_initial\")\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      reweight_type: Push towards initial or final states: a string matching a\n          known reweight type: one of \"to_initial\", \"to_final\"\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_49reweight = {"reweight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_49reweight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_48reweight};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_49reweight(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_potentials = 0;
  PyObject *__pyx_v_reweight_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reweight (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_potentials,&__pyx_mstate_global->__pyx_n_u_reweight_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2926, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reweight", 0) < 0) __PYX_ERR(0, 2926, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, i); __PYX_ERR(0, 2926, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2926, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2926, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial));
    }
    __pyx_v_potentials = values[0];
    __pyx_v_reweight_type = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reweight", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 2926, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_48reweight(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_potentials, __pyx_v_reweight_type);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_48reweight(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_potentials, PyObject *__pyx_v_reweight_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reweight", 0);

  /* "pywrapfst.pyx":2949
 *       self.
 *     """
 *     self._reweight(potentials, reweight_type)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reweight");
    __PYX_ERR(0, 2949, __pyx_L1_error)
  }
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.reweight_type = __pyx_v_reweight_type;
  ((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, 2949, __pyx_L1_error)

  /* "pywrapfst.pyx":2950
 *     """
 *     self._reweight(potentials, reweight_type)
 *     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":2926
 *     self._check_mutating_imethod()
 * 
 *   def reweight(self, potentials, reweight_type="to_initial"):             # <<<<<<<<<<<<<<
 *     """
 *     reweight(self, potentials, reweight_type="to_initial")
*/

  /* 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":2952
 *     return self
 * 
 *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
 *                        queue_type="auto",
 *                        bool connect=True,
*/

static void __pyx_f_9pywrapfst_10MutableFst__rmepsilon(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args) {
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_auto);

  /* "pywrapfst.pyx":2954
 *   cdef void _rmepsilon(self,
 *                        queue_type="auto",
 *                        bool connect=True,             # <<<<<<<<<<<<<<
 *                        weight=None,
 *                        int64_t nstate=fst.kNoStateId,
*/
  bool __pyx_v_connect = ((bool)1);

  /* "pywrapfst.pyx":2955
 *                        queue_type="auto",
 *                        bool connect=True,
 *                        weight=None,             # <<<<<<<<<<<<<<
 *                        int64_t nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:
*/
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  int64_t __pyx_v_nstate = __pyx_mstate_global->__pyx_k__15;
  float __pyx_v_delta = __pyx_mstate_global->__pyx_k__16;
  fst::script::WeightClass __pyx_v__weight;
  std::unique_ptr<fst::script::RmEpsilonOptions>  __pyx_v__opts;
  std::string __pyx_t_1;
  fst::script::WeightClass __pyx_t_2;
  enum fst::QueueType __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 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":2958
 *                        int64_t nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                             weight)
 *     cdef unique_ptr[fst.RmEpsilonOptions] _opts
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 2958, __pyx_L1_error)
  }
  __pyx_t_1 = ((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); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2958, __pyx_L1_error)

  /* "pywrapfst.pyx":2959
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.RmEpsilonOptions] _opts
 *     _opts.reset(
*/
  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_zero(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2958, __pyx_L1_error)
  __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pywrapfst.pyx":2962
 *     cdef unique_ptr[fst.RmEpsilonOptions] _opts
 *     _opts.reset(
 *         new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),             # <<<<<<<<<<<<<<
 *                                  connect,
 *                                  _weight,
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2962, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 2962, __pyx_L1_error)

  /* "pywrapfst.pyx":2961
 *                                                             weight)
 *     cdef unique_ptr[fst.RmEpsilonOptions] _opts
 *     _opts.reset(             # <<<<<<<<<<<<<<
 *         new fst.RmEpsilonOptions(_get_queue_type(tostring(queue_type)),
 *                                  connect,
*/
  __pyx_v__opts.reset(new fst::script::RmEpsilonOptions(__pyx_t_3, __pyx_v_connect, __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta));

  /* "pywrapfst.pyx":2967
 *                                  nstate,
 *                                  delta))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.RmEpsilon(self._mfst.get(), deref(_opts))
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":2968
 *                                  delta))
 *     with nogil:
 *       fst.RmEpsilon(self._mfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 2968, __pyx_L4_error)
        }
        fst::script::RmEpsilon(__pyx_v_self->_mfst.get(), (*__pyx_v__opts));
      }

      /* "pywrapfst.pyx":2967
 *                                  nstate,
 *                                  delta))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.RmEpsilon(self._mfst.get(), deref(_opts))
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":2969
 *     with nogil:
 *       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, 2969, __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, 2969, __pyx_L1_error)

  /* "pywrapfst.pyx":2952
 *     return self
 * 
 *   cdef void _rmepsilon(self,             # <<<<<<<<<<<<<<
 *                        queue_type="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:;
}

/* "pywrapfst.pyx":2971
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type="auto",
 *                 bool connect=True,
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_51rmepsilon(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_50rmepsilon, "\n    rmepsilon(self, queue_type=\"auto\", connect=True, weight=None,\n              nstate=NO_STATE_ID, delta=1e-6):\n\n    Removes epsilon transitions.\n\n    This operation destructively removes epsilon transitions, i.e., those where\n    both input and output labels are epsilon) from an FST.\n\n    Args:\n      queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n          \"lifo\", \"shortest\", \"state\", \"top\".\n      connect: Should output be trimmed?\n      weight: A Weight or weight string indicating the desired weight threshold\n          below which paths are pruned; if omitted, no paths are pruned.\n      nstate: State number threshold.\n      delta: Comparison/quantization delta.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_51rmepsilon = {"rmepsilon", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_51rmepsilon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_50rmepsilon};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_51rmepsilon(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_queue_type = 0;
  bool __pyx_v_connect;
  PyObject *__pyx_v_weight = 0;
  int64_t __pyx_v_nstate;
  float __pyx_v_delta;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rmepsilon (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_queue_type,&__pyx_mstate_global->__pyx_n_u_connect,&__pyx_mstate_global->__pyx_n_u_weight,&__pyx_mstate_global->__pyx_n_u_nstate,&__pyx_mstate_global->__pyx_n_u_delta,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 2971, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "rmepsilon", 0) < 0) __PYX_ERR(0, 2971, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));

      /* "pywrapfst.pyx":2974
 *                 queue_type="auto",
 *                 bool connect=True,
 *                 weight=None,             # <<<<<<<<<<<<<<
 *                 int64_t nstate=fst.kNoStateId,
 *                 float delta=fst.kShortestDelta):
*/
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 2971, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 2973, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":2973
 *   def rmepsilon(self,
 *                 queue_type="auto",
 *                 bool connect=True,             # <<<<<<<<<<<<<<
 *                 weight=None,
 *                 int64_t nstate=fst.kNoStateId,
*/
      __pyx_v_connect = ((bool)1);
    }
    __pyx_v_weight = values[2];
    if (values[3]) {
      __pyx_v_nstate = __Pyx_PyLong_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 2975, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_mstate_global->__pyx_k__17;
    }
    if (values[4]) {
      __pyx_v_delta = __Pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 2976, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__18;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rmepsilon", 0, 0, 5, __pyx_nargs); __PYX_ERR(0, 2971, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_50rmepsilon(((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":2971
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type="auto",
 *                 bool connect=True,
*/

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_50rmepsilon(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_queue_type, bool __pyx_v_connect, PyObject *__pyx_v_weight, int64_t __pyx_v_nstate, float __pyx_v_delta) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("rmepsilon", 0);

  /* "pywrapfst.pyx":2998
 *       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, 2998, __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, 2998, __pyx_L1_error)

  /* "pywrapfst.pyx":2999
 *     """
 *     self._rmepsilon(queue_type, connect, weight, nstate, delta)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_final(self, int64_t 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":2971
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type="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":3001
 *     return self
 * 
 *   cdef void _set_final(self, int64_t state, weight=None) except *:             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
*/

static void __pyx_f_9pywrapfst_10MutableFst__set_final(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final *__pyx_optional_args) {
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  fst::script::WeightClass __pyx_v__weight;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  fst::script::WeightClass __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_final", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_weight = __pyx_optional_args->weight;
    }
  }

  /* "pywrapfst.pyx":3002
 * 
 *   cdef void _set_final(self, int64_t state, weight=None) except *:
 *     if not self._mfst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3002, __pyx_L1_error)
  }
  __pyx_t_1 = (!(__pyx_v_self->_mfst.get()->ValidStateId(__pyx_v_state) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":3003
 *   cdef void _set_final(self, int64_t state, weight=None) except *:
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 *                                                           weight)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3003, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3003, __pyx_L1_error)

    /* "pywrapfst.pyx":3002
 * 
 *   cdef void _set_final(self, int64_t state, weight=None) except *:
 *     if not self._mfst.get().ValidStateId(state):             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
*/
  }

  /* "pywrapfst.pyx":3004
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),             # <<<<<<<<<<<<<<
 *                                                           weight)
 *     if not self._mfst.get().SetFinal(state, _weight):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 3004, __pyx_L1_error)
  }
  __pyx_t_6 = ((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); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3004, __pyx_L1_error)

  /* "pywrapfst.pyx":3005
 *       raise FstIndexError("State index out of range")
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 *                                                           weight)             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().SetFinal(state, _weight):
 *       raise FstOpError("Incompatible or invalid weight")
*/
  __pyx_t_7 = __pyx_f_9pywrapfst__get_WeightClass_or_one(__pyx_t_6, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3004, __pyx_L1_error)
  __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pywrapfst.pyx":3006
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 *                                                           weight)
 *     if not self._mfst.get().SetFinal(state, _weight):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight")
 *     self._check_mutating_imethod()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3006, __pyx_L1_error)
  }
  __pyx_t_1 = (!(__pyx_v_self->_mfst.get()->SetFinal(__pyx_v_state, __pyx_v__weight) != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":3007
 *                                                           weight)
 *     if not self._mfst.get().SetFinal(state, _weight):
 *       raise FstOpError("Incompatible or invalid weight")             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Incompatible_or_invalid_weight};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3007, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3007, __pyx_L1_error)

    /* "pywrapfst.pyx":3006
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(self.weight_type(),
 *                                                           weight)
 *     if not self._mfst.get().SetFinal(state, _weight):             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid weight")
 *     self._check_mutating_imethod()
*/
  }

  /* "pywrapfst.pyx":3008
 *     if not self._mfst.get().SetFinal(state, _weight):
 *       raise FstOpError("Incompatible or invalid weight")
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 * 
 *   def set_final(self, int64_t 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, 3008, __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, 3008, __pyx_L1_error)

  /* "pywrapfst.pyx":3001
 *     return self
 * 
 *   cdef void _set_final(self, int64_t state, weight=None) except *:             # <<<<<<<<<<<<<<
 *     if not self._mfst.get().ValidStateId(state):
 *       raise FstIndexError("State index out of range")
*/

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

/* "pywrapfst.pyx":3010
 *     self._check_mutating_imethod()
 * 
 *   def set_final(self, int64_t state, weight=None):             # <<<<<<<<<<<<<<
 *     """
 *     set_final(self, state, weight)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_53set_final(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_52set_final, "\n    set_final(self, state, weight)\n\n    Sets the final weight for a state.\n\n    Args:\n      state: The integer index of a state.\n      weight: A Weight or weight string indicating the desired final weight; if\n          omitted, it is set to semiring One.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n      FstOpError: Incompatible or invalid weight.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_53set_final = {"set_final", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_53set_final, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_52set_final};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_53set_final(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  PyObject *__pyx_v_weight = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_final (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3010, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_final", 0) < 0) __PYX_ERR(0, 3010, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, i); __PYX_ERR(0, 3010, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3010, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3010, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3010, __pyx_L3_error)
    __pyx_v_weight = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_final", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 3010, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_52set_final(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state, __pyx_v_weight);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_52set_final(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state, PyObject *__pyx_v_weight) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_final", 0);

  /* "pywrapfst.pyx":3028
 *       FstOpError: Incompatible or invalid weight.
 *     """
 *     self._set_final(state, weight)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_final");
    __PYX_ERR(0, 3028, __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, 3028, __pyx_L1_error)

  /* "pywrapfst.pyx":3029
 *     """
 *     self._set_final(state, weight)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3010
 *     self._check_mutating_imethod()
 * 
 *   def set_final(self, int64_t 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":3031
 *     return self
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     cdef Symbol
 *     if symbols is None:
*/

static void __pyx_f_9pywrapfst_10MutableFst__set_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  int __pyx_t_1;
  fst::SymbolTable const *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3033
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     cdef Symbol
 *     if symbols is None:             # <<<<<<<<<<<<<<
 * 
 *       self._mfst.get().SetInputSymbols(NULL)
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":3035
 *     if symbols is None:
 * 
 *       self._mfst.get().SetInputSymbols(NULL)             # <<<<<<<<<<<<<<
 *       return
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
*/
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 3035, __pyx_L1_error)
    }
    __pyx_v_self->_mfst.get()->SetInputSymbols(NULL);

    /* "pywrapfst.pyx":3036
 * 
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return             # <<<<<<<<<<<<<<
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
*/
    goto __pyx_L0;

    /* "pywrapfst.pyx":3033
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:
 *     cdef Symbol
 *     if symbols is None:             # <<<<<<<<<<<<<<
 * 
 *       self._mfst.get().SetInputSymbols(NULL)
*/
  }

  /* "pywrapfst.pyx":3037
 *       self._mfst.get().SetInputSymbols(NULL)
 *       return
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())             # <<<<<<<<<<<<<<
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3037, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 3037, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3037, __pyx_L1_error)
  __pyx_v_self->_mfst.get()->SetInputSymbols(__pyx_t_2);

  /* "pywrapfst.pyx":3031
 *     return self
 * 
 *   cdef void _set_input_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     cdef Symbol
 *     if symbols is None:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":3039
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_55set_input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_54set_input_symbols, "\n    set_input_symbols(self, symbols)\n\n    Sets the input symbol table.\n\n    Passing None as a value will delete the input symbol table.\n\n    Args:\n      symbols: A SymbolTable.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_55set_input_symbols = {"set_input_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_55set_input_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_54set_input_symbols};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_55set_input_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_input_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symbols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3039, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3039, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_input_symbols", 0) < 0) __PYX_ERR(0, 3039, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_input_symbols", 1, 1, 1, i); __PYX_ERR(0, 3039, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3039, __pyx_L3_error)
    }
    __pyx_v_symbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_input_symbols", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3039, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.MutableFst.set_input_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 3039, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_54set_input_symbols(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_symbols);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_54set_input_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_input_symbols", 0);

  /* "pywrapfst.pyx":3053
 *       self.
 *     """
 *     self._set_input_symbols(symbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_input_symbols");
    __PYX_ERR(0, 3053, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_input_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3053, __pyx_L1_error)

  /* "pywrapfst.pyx":3054
 *     """
 *     self._set_input_symbols(symbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3039
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("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":3056
 *     return self
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
*/

static void __pyx_f_9pywrapfst_10MutableFst__set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  int __pyx_t_1;
  fst::SymbolTable const *__pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3057
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
*/
  __pyx_t_1 = (((PyObject *)__pyx_v_symbols) == Py_None);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":3058
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:
 *       self._mfst.get().SetOutputSymbols(NULL)             # <<<<<<<<<<<<<<
 *       return
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
*/
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
      __PYX_ERR(0, 3058, __pyx_L1_error)
    }
    __pyx_v_self->_mfst.get()->SetOutputSymbols(NULL);

    /* "pywrapfst.pyx":3059
 *     if symbols is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return             # <<<<<<<<<<<<<<
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
*/
    goto __pyx_L0;

    /* "pywrapfst.pyx":3057
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:
 *     if symbols is None:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
*/
  }

  /* "pywrapfst.pyx":3060
 *       self._mfst.get().SetOutputSymbols(NULL)
 *       return
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())             # <<<<<<<<<<<<<<
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3060, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_symbols) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
    __PYX_ERR(0, 3060, __pyx_L1_error)
  }
  __pyx_t_2 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTableView *)__pyx_v_symbols->__pyx_vtab)->_raw_ptr_or_raise(__pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3060, __pyx_L1_error)
  __pyx_v_self->_mfst.get()->SetOutputSymbols(__pyx_t_2);

  /* "pywrapfst.pyx":3056
 *     return self
 * 
 *   cdef void _set_output_symbols(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     if symbols is None:
 *       self._mfst.get().SetOutputSymbols(NULL)
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst.MutableFst._set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":3062
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_57set_output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_56set_output_symbols, "\n    set_output_symbols(self, symbols)\n\n    Sets the output symbol table.\n\n    Passing None as a value will delete the output symbol table.\n\n    Args:\n      symbols: A SymbolTable.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_57set_output_symbols = {"set_output_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_57set_output_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_56set_output_symbols};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_57set_output_symbols(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_output_symbols (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_symbols,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3062, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3062, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_output_symbols", 0) < 0) __PYX_ERR(0, 3062, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_output_symbols", 1, 1, 1, i); __PYX_ERR(0, 3062, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3062, __pyx_L3_error)
    }
    __pyx_v_symbols = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_output_symbols", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3062, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.MutableFst.set_output_symbols", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_symbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, 1, "symbols", 0))) __PYX_ERR(0, 3062, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_56set_output_symbols(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_symbols);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_56set_output_symbols(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, struct __pyx_obj_9pywrapfst_SymbolTableView *__pyx_v_symbols) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_output_symbols", 0);

  /* "pywrapfst.pyx":3076
 *       self.
 *     """
 *     self._set_output_symbols(symbols)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_output_symbols");
    __PYX_ERR(0, 3076, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_MutableFst *)__pyx_v_self->__pyx_base.__pyx_vtab)->_set_output_symbols(__pyx_v_self, __pyx_v_symbols); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3076, __pyx_L1_error)

  /* "pywrapfst.pyx":3077
 *     """
 *     self._set_output_symbols(symbols)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   def set_properties(self, props, mask):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3062
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("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":3079
 *     return self
 * 
 *   def set_properties(self, props, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_properties(self, props, mask)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_59set_properties(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_58set_properties, "\n    set_properties(self, props, mask)\n\n    Sets the properties.\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 PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_59set_properties = {"set_properties", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_59set_properties, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_58set_properties};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_59set_properties(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_props = 0;
  PyObject *__pyx_v_mask = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_properties (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_props,&__pyx_mstate_global->__pyx_n_u_mask,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3079, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3079, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_properties", 0) < 0) __PYX_ERR(0, 3079, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, i); __PYX_ERR(0, 3079, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3079, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3079, __pyx_L3_error)
    }
    __pyx_v_props = values[0];
    __pyx_v_mask = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_properties", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3079, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_58set_properties(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_props, __pyx_v_mask);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_58set_properties(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_props, PyObject *__pyx_v_mask) {
  uint64_t __pyx_v__props;
  uint64_t __pyx_v__mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint64_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_properties", 0);

  /* "pywrapfst.pyx":3093
 *       self.
 *     """
 *     cdef uint64_t _props = props.value             # <<<<<<<<<<<<<<
 *     cdef uint64_t _mask = mask.value
 *     with nogil:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_props, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__props = __pyx_t_2;

  /* "pywrapfst.pyx":3094
 *     """
 *     cdef uint64_t _props = props.value
 *     cdef uint64_t _mask = mask.value             # <<<<<<<<<<<<<<
 *     with nogil:
 *       self._mfst.get().SetProperties(_props, _mask)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_uint64_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3094, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__mask = __pyx_t_2;

  /* "pywrapfst.pyx":3095
 *     cdef uint64_t _props = props.value
 *     cdef uint64_t _mask = mask.value
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetProperties(_props, _mask)
 *     return self
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3096
 *     cdef uint64_t _mask = mask.value
 *     with nogil:
 *       self._mfst.get().SetProperties(_props, _mask)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3096, __pyx_L4_error)
        }
        __pyx_v_self->_mfst.get()->SetProperties(__pyx_v__props, __pyx_v__mask);
      }

      /* "pywrapfst.pyx":3095
 *     cdef uint64_t _props = props.value
 *     cdef uint64_t _mask = mask.value
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mfst.get().SetProperties(_props, _mask)
 *     return self
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3097
 *     with nogil:
 *       self._mfst.get().SetProperties(_props, _mask)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _set_start(self, int64_t state) except *:
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3079
 *     return self
 * 
 *   def set_properties(self, props, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_properties(self, props, mask)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("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":3099
 *     return self
 * 
 *   cdef void _set_start(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

static void __pyx_f_9pywrapfst_10MutableFst__set_start(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state) {
  bool __pyx_v__result;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_set_start", 0);

  /* "pywrapfst.pyx":3101
 *   cdef void _set_start(self, int64_t state) except *:
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._mfst.get().SetStart(state)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3102
 *     cdef bool _result
 *     with nogil:
 *       _result = self._mfst.get().SetStart(state)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIndexError("State index out of range")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3102, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_self->_mfst.get()->SetStart(__pyx_v_state);
      }

      /* "pywrapfst.pyx":3101
 *   cdef void _set_start(self, int64_t state) except *:
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._mfst.get().SetStart(state)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3103
 *     with nogil:
 *       _result = self._mfst.get().SetStart(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 * 
*/
  __pyx_t_1 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":3104
 *       _result = self._mfst.get().SetStart(state)
 *     if not _result:
 *       raise FstIndexError("State index out of range")             # <<<<<<<<<<<<<<
 * 
 *   def set_start(self, int64_t state):
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3104, __pyx_L1_error)

    /* "pywrapfst.pyx":3103
 *     with nogil:
 *       _result = self._mfst.get().SetStart(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 * 
*/
  }

  /* "pywrapfst.pyx":3099
 *     return self
 * 
 *   cdef void _set_start(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

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

/* "pywrapfst.pyx":3106
 *       raise FstIndexError("State index out of range")
 * 
 *   def set_start(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     set_start(self, state)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_61set_start(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_60set_start, "\n    set_start(self, state)\n\n    Sets a state to be the initial state state.\n\n    Args:\n      state: The integer index of a state.\n\n    Returns:\n      self.\n\n    Raises:\n      FstIndexError: State index out of range.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_61set_start = {"set_start", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_61set_start, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_60set_start};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_61set_start(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  int64_t __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_start (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3106, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3106, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_start", 0) < 0) __PYX_ERR(0, 3106, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_start", 1, 1, 1, i); __PYX_ERR(0, 3106, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3106, __pyx_L3_error)
    }
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3106, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_start", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3106, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_10MutableFst_60set_start(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_state);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_60set_start(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, int64_t __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_start", 0);

  /* "pywrapfst.pyx":3121
 *       FstIndexError: State index out of range.
 *     """
 *     self._set_start(state)             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_set_start");
    __PYX_ERR(0, 3121, __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, 3121, __pyx_L1_error)

  /* "pywrapfst.pyx":3122
 *     """
 *     self._set_start(state)
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   cdef void _topsort(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3106
 *       raise FstIndexError("State index out of range")
 * 
 *   def set_start(self, int64_t 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":3124
 *     return self
 * 
 *   cdef void _topsort(self):             # <<<<<<<<<<<<<<
 *     cdef bool _is_acyclic
 *     with nogil:
*/

static void __pyx_f_9pywrapfst_10MutableFst__topsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  bool __pyx_v__is_acyclic;
  __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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_topsort", 0);

  /* "pywrapfst.pyx":3126
 *   cdef void _topsort(self):
 *     cdef bool _is_acyclic
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _is_acyclic = fst.TopSort(self._mfst.get())
 *     if not _is_acyclic:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3127
 *     cdef bool _is_acyclic
 *     with nogil:
 *       _is_acyclic = fst.TopSort(self._mfst.get())             # <<<<<<<<<<<<<<
 *     if not _is_acyclic:
 *       logging.warning("Cannot topsort cyclic FST")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3127, __pyx_L4_error)
        }
        __pyx_v__is_acyclic = fst::script::TopSort(__pyx_v_self->_mfst.get());
      }

      /* "pywrapfst.pyx":3126
 *   cdef void _topsort(self):
 *     cdef bool _is_acyclic
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _is_acyclic = fst.TopSort(self._mfst.get())
 *     if not _is_acyclic:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3128
 *     with nogil:
 *       _is_acyclic = fst.TopSort(self._mfst.get())
 *     if not _is_acyclic:             # <<<<<<<<<<<<<<
 *       logging.warning("Cannot topsort cyclic FST")
 * 
*/
  __pyx_t_1 = (!(__pyx_v__is_acyclic != 0));
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":3129
 *       _is_acyclic = fst.TopSort(self._mfst.get())
 *     if not _is_acyclic:
 *       logging.warning("Cannot topsort cyclic FST")             # <<<<<<<<<<<<<<
 * 
 *   def topsort(self):
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_logging); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_warning); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Cannot_topsort_cyclic_FST};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pywrapfst.pyx":3128
 *     with nogil:
 *       _is_acyclic = fst.TopSort(self._mfst.get())
 *     if not _is_acyclic:             # <<<<<<<<<<<<<<
 *       logging.warning("Cannot topsort cyclic FST")
 * 
*/
  }

  /* "pywrapfst.pyx":3124
 *     return self
 * 
 *   cdef void _topsort(self):             # <<<<<<<<<<<<<<
 *     cdef bool _is_acyclic
 *     with nogil:
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pywrapfst.MutableFst._topsort", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "pywrapfst.pyx":3131
 *       logging.warning("Cannot topsort cyclic FST")
 * 
 *   def topsort(self):             # <<<<<<<<<<<<<<
 *     """
 *     topsort(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_63topsort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_62topsort, "\n    topsort(self)\n\n    Sorts transitions by state IDs.\n\n    This operation destructively topologically sorts the FST, if it is acyclic;\n    otherwise it remains unchanged. Once sorted, all transitions are from lower\n    state IDs to higher state IDs\n\n    Returns:\n       self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_63topsort = {"topsort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_63topsort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_62topsort};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_63topsort(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("topsort (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("topsort", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("topsort", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_62topsort(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_62topsort(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("topsort", 0);

  /* "pywrapfst.pyx":3144
 *        self.
 *     """
 *     self._topsort()             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_topsort");
    __PYX_ERR(0, 3144, __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, 3144, __pyx_L1_error)

  /* "pywrapfst.pyx":3145
 *     """
 *     self._topsort()
 *     return self             # <<<<<<<<<<<<<<
 * 
 *   def union(self, *fsts2):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3131
 *       logging.warning("Cannot topsort cyclic FST")
 * 
 *   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":3147
 *     return self
 * 
 *   def union(self, *fsts2):             # <<<<<<<<<<<<<<
 *     """
 *     union(self, *fsts2)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_65union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_10MutableFst_64union, "\n    union(self, *fsts2)\n\n    Computes the union (sum) of two or more FSTs.\n\n    This operation computes the union of two or more FSTs. If A transduces\n    string x to y with weight a and B transduces string w to v with weight b,\n    then their union transduces x to y with weight a and w to v with weight b.\n\n    Args:\n      *fsts2: One or more input FSTs.\n\n    Returns:\n      self.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_10MutableFst_65union = {"union", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_65union, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_64union};
static PyObject *__pyx_pw_9pywrapfst_10MutableFst_65union(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fsts2 = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("union (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("union", __pyx_kwds); return NULL;}
  __Pyx_INCREF(__pyx_args);
  __pyx_v_fsts2 = __pyx_args;
  __pyx_r = __pyx_pf_9pywrapfst_10MutableFst_64union(((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_v_self), __pyx_v_fsts2);

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

static PyObject *__pyx_pf_9pywrapfst_10MutableFst_64union(struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_self, PyObject *__pyx_v_fsts2) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v__fst2 = 0;
  std::vector<__pyx_t_9pywrapfst_const_FstClass_ptr>  __pyx_v__fsts2;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("union", 0);

  /* "pywrapfst.pyx":3165
 *     cdef Fst _fst2
 *     cdef vector[const_FstClass_ptr] _fsts2
 *     for _fst2 in fsts2:             # <<<<<<<<<<<<<<
 *       _fsts2.push_back(_fst2._fst.get())
 *     with nogil:
*/
  __pyx_t_1 = __pyx_v_fsts2; __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  for (;;) {
    {
      Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
      #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 3165, __pyx_L1_error)
      #endif
      if (__pyx_t_2 >= __pyx_temp) break;
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_3 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
    #else
    __pyx_t_3 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
    #endif
    ++__pyx_t_2;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3165, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 3165, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v__fst2, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "pywrapfst.pyx":3166
 *     cdef vector[const_FstClass_ptr] _fsts2
 *     for _fst2 in fsts2:
 *       _fsts2.push_back(_fst2._fst.get())             # <<<<<<<<<<<<<<
 *     with nogil:
 *       fst.Union(self._mfst.get(), _fsts2)
*/
    if (unlikely(((PyObject *)__pyx_v__fst2) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 3166, __pyx_L1_error)
    }
    try {
      __pyx_v__fsts2.push_back(__pyx_v__fst2->_fst.get());
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 3166, __pyx_L1_error)
    }

    /* "pywrapfst.pyx":3165
 *     cdef Fst _fst2
 *     cdef vector[const_FstClass_ptr] _fsts2
 *     for _fst2 in fsts2:             # <<<<<<<<<<<<<<
 *       _fsts2.push_back(_fst2._fst.get())
 *     with nogil:
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":3167
 *     for _fst2 in fsts2:
 *       _fsts2.push_back(_fst2._fst.get())
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Union(self._mfst.get(), _fsts2)
 *     self._check_mutating_imethod()
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3168
 *       _fsts2.push_back(_fst2._fst.get())
 *     with nogil:
 *       fst.Union(self._mfst.get(), _fsts2)             # <<<<<<<<<<<<<<
 *     self._check_mutating_imethod()
 *     return self
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3168, __pyx_L7_error)
        }
        fst::script::Union(__pyx_v_self->_mfst.get(), __pyx_v__fsts2);
      }

      /* "pywrapfst.pyx":3167
 *     for _fst2 in fsts2:
 *       _fsts2.push_back(_fst2._fst.get())
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.Union(self._mfst.get(), _fsts2)
 *     self._check_mutating_imethod()
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L8;
        }
        __pyx_L7_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L8:;
      }
  }

  /* "pywrapfst.pyx":3169
 *     with nogil:
 *       fst.Union(self._mfst.get(), _fsts2)
 *     self._check_mutating_imethod()             # <<<<<<<<<<<<<<
 *     return self
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_check_mutating_imethod");
    __PYX_ERR(0, 3169, __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, 3169, __pyx_L1_error)

  /* "pywrapfst.pyx":3170
 *       fst.Union(self._mfst.get(), _fsts2)
 *     self._check_mutating_imethod()
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3147
 *     return self
 * 
 *   def union(self, *fsts2):             # <<<<<<<<<<<<<<
 *     """
 *     union(self, *fsts2)
*/

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

/* "pywrapfst.pyx":3186
 *   """
 * 
 *   def __init__(self, arc_type="standard"):             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
*/

/* Python wrapper */
static int __pyx_pw_9pywrapfst_9VectorFst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_9VectorFst_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_arc_type = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_arc_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3186, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3186, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 3186, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_standard));
    } else {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3186, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_standard));
    }
    __pyx_v_arc_type = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 3186, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.VectorFst.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_9VectorFst___init__(((struct __pyx_obj_9pywrapfst_VectorFst *)__pyx_v_self), __pyx_v_arc_type);

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

static int __pyx_pf_9pywrapfst_9VectorFst___init__(struct __pyx_obj_9pywrapfst_VectorFst *__pyx_v_self, PyObject *__pyx_v_arc_type) {
  std::unique_ptr<fst::script::MutableFstClass>  __pyx_v__tfst;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":3188
 *   def __init__(self, arc_type="standard"):
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))             # <<<<<<<<<<<<<<
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3188, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":3189
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 *     self._fst.reset(_tfst.release())
*/
  __pyx_t_2 = (__pyx_v__tfst.get()->Properties(fst::kError, 1) == fst::kError);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3190
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")             # <<<<<<<<<<<<<<
 *     self._fst.reset(_tfst.release())
 *     self._mfst = static_pointer_cast[fst.MutableFstClass,
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_arc_type), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_arc_type, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3190, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3190, __pyx_L1_error)

    /* "pywrapfst.pyx":3189
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 *     self._fst.reset(_tfst.release())
*/
  }

  /* "pywrapfst.pyx":3191
 *     if _tfst.get().Properties(fst.kError, True) == fst.kError:
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 *     self._fst.reset(_tfst.release())             # <<<<<<<<<<<<<<
 *     self._mfst = static_pointer_cast[fst.MutableFstClass,
 *                                      fst.FstClass](self._fst)
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3191, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base.__pyx_base._fst.reset(__pyx_v__tfst.release());

  /* "pywrapfst.pyx":3193
 *     self._fst.reset(_tfst.release())
 *     self._mfst = static_pointer_cast[fst.MutableFstClass,
 *                                      fst.FstClass](self._fst)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3193, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":3192
 *       raise FstOpError(f"Unknown arc type: {arc_type!r}")
 *     self._fst.reset(_tfst.release())
 *     self._mfst = static_pointer_cast[fst.MutableFstClass,             # <<<<<<<<<<<<<<
 *                                      fst.FstClass](self._fst)
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3192, __pyx_L1_error)
  }
  __pyx_v_self->__pyx_base._mfst = std::static_pointer_cast<fst::script::MutableFstClass,fst::script::FstClass>(__pyx_v_self->__pyx_base.__pyx_base._fst);

  /* "pywrapfst.pyx":3186
 *   """
 * 
 *   def __init__(self, arc_type="standard"):             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.MutableFstClass] _tfst
 *     _tfst.reset(new fst.VectorFstClass(tostring(arc_type)))
*/

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

/* "pywrapfst.pyx":3212
 * 
 * 
 * cdef Fst _init_Fst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_Fst", 0);

  /* "pywrapfst.pyx":3213
 * 
 * cdef Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef Fst _ofst = Fst.__new__(Fst)
*/
  __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError);
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":3214
 * cdef Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef Fst _ofst = Fst.__new__(Fst)
 *   _ofst._fst.reset(tfst)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Operation_failed};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3214, __pyx_L1_error)

    /* "pywrapfst.pyx":3213
 * 
 * cdef Fst _init_Fst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef Fst _ofst = Fst.__new__(Fst)
*/
  }

  /* "pywrapfst.pyx":3215
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
 *   cdef Fst _ofst = Fst.__new__(Fst)             # <<<<<<<<<<<<<<
 *   _ofst._fst.reset(tfst)
 *   return _ofst
*/
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst_Fst(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3215, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_2);
  __pyx_v__ofst = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3216
 *     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, 3216, __pyx_L1_error)
  }
  __pyx_v__ofst->_fst.reset(__pyx_v_tfst);

  /* "pywrapfst.pyx":3217
 *   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":3212
 * 
 * 
 * cdef Fst _init_Fst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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":3220
 * 
 * 
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     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;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_MutableFst", 0);

  /* "pywrapfst.pyx":3221
 * 
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
*/
  __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kError, 1) == fst::kError);
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":3222
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")             # <<<<<<<<<<<<<<
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
 *   _ofst._fst.reset(tfst)
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Operation_failed};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3222, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3222, __pyx_L1_error)

    /* "pywrapfst.pyx":3221
 * 
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):
 *   if tfst.Properties(fst.kError, True) == fst.kError:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Operation failed")
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
*/
  }

  /* "pywrapfst.pyx":3223
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)             # <<<<<<<<<<<<<<
 *   _ofst._fst.reset(tfst)
 *   # Makes a copy of it as the derived type! Cool.
*/
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_9pywrapfst_MutableFst(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3223, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_2);
  __pyx_v__ofst = ((struct __pyx_obj_9pywrapfst_MutableFst *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3224
 *     raise FstOpError("Operation failed")
 *   cdef MutableFst _ofst = MutableFst.__new__(MutableFst)
 *   _ofst._fst.reset(tfst)             # <<<<<<<<<<<<<<
 *   # Makes a copy of it as the derived type! Cool.
 *   _ofst._mfst = static_pointer_cast[fst.MutableFstClass,
*/
  if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
    __PYX_ERR(0, 3224, __pyx_L1_error)
  }
  __pyx_v__ofst->__pyx_base._fst.reset(__pyx_v_tfst);

  /* "pywrapfst.pyx":3227
 *   # 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, 3227, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":3226
 *   _ofst._fst.reset(tfst)
 *   # Makes a copy of it as the derived type! Cool.
 *   _ofst._mfst = static_pointer_cast[fst.MutableFstClass,             # <<<<<<<<<<<<<<
 *                                     fst.FstClass](_ofst._fst)
 *   return _ofst
*/
  if (unlikely(((PyObject *)__pyx_v__ofst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3226, __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":3228
 *   _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":3220
 * 
 * 
 * cdef MutableFst _init_MutableFst(MutableFstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kError, True) == fst.kError:
 *     raise FstOpError("Operation failed")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("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":3231
 * 
 * 
 * cdef Fst _init_XFst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
*/

static struct __pyx_obj_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_XFst", 0);

  /* "pywrapfst.pyx":3232
 * 
 * cdef Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:             # <<<<<<<<<<<<<<
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 *   else:
*/
  __pyx_t_1 = (__pyx_v_tfst->Properties(fst::kMutable, 1) == fst::kMutable);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":3233
 * cdef Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))             # <<<<<<<<<<<<<<
 *   else:
 *     return _init_Fst(tfst)
*/
    __Pyx_XDECREF((PyObject *)__pyx_r);
    __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_MutableFst(static_cast<__pyx_t_9pywrapfst_MutableFstClass_ptr>(__pyx_v_tfst))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3233, __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":3232
 * 
 * cdef Fst _init_XFst(FstClass_ptr tfst):
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:             # <<<<<<<<<<<<<<
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
 *   else:
*/
  }

  /* "pywrapfst.pyx":3235
 *     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, 3235, __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":3231
 * 
 * 
 * cdef Fst _init_XFst(FstClass_ptr tfst):             # <<<<<<<<<<<<<<
 *   if tfst.Properties(fst.kMutable, True) == fst.kMutable:
 *     return _init_MutableFst(static_cast[MutableFstClass_ptr](tfst))
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("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":3238
 * 
 * 
 * cpdef Fst _read_Fst(source):             # <<<<<<<<<<<<<<
 *   cdef string _source = path_tostring(source)
 *   cdef unique_ptr[fst.FstClass] _tfst
*/

static PyObject *__pyx_pw_9pywrapfst_17_read_Fst(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst(PyObject *__pyx_v_source, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::string __pyx_v__source;
  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;
  size_t __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_Fst", 0);

  /* "pywrapfst.pyx":3239
 * 
 * cpdef Fst _read_Fst(source):
 *   cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3239, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":3241
 *   cdef string _source = path_tostring(source)
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _tfst = fst.FstClass.Read(_source)
 *   if _tfst.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3242
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:
 *     _tfst = fst.FstClass.Read(_source)             # <<<<<<<<<<<<<<
 *   if _tfst.get() == NULL:
 *     raise FstIOError(f"Read failed: {source!r}")
*/
        __pyx_v__tfst = fst::script::FstClass::Read(__pyx_v__source);
      }

      /* "pywrapfst.pyx":3241
 *   cdef string _source = path_tostring(source)
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _tfst = fst.FstClass.Read(_source)
 *   if _tfst.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3243
 *   with nogil:
 *     _tfst = fst.FstClass.Read(_source)
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError(f"Read failed: {source!r}")
 *   return _init_XFst(_tfst.release())
*/
  __pyx_t_2 = (__pyx_v__tfst.get() == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3244
 *     _tfst = fst.FstClass.Read(_source)
 *   if _tfst.get() == NULL:
 *     raise FstIOError(f"Read failed: {source!r}")             # <<<<<<<<<<<<<<
 *   return _init_XFst(_tfst.release())
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Read_failed, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3244, __pyx_L1_error)

    /* "pywrapfst.pyx":3243
 *   with nogil:
 *     _tfst = fst.FstClass.Read(_source)
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError(f"Read failed: {source!r}")
 *   return _init_XFst(_tfst.release())
*/
  }

  /* "pywrapfst.pyx":3245
 *   if _tfst.get() == NULL:
 *     raise FstIOError(f"Read failed: {source!r}")
 *   return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3245, __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":3238
 * 
 * 
 * cpdef Fst _read_Fst(source):             # <<<<<<<<<<<<<<
 *   cdef string _source = path_tostring(source)
 *   cdef unique_ptr[fst.FstClass] _tfst
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_17_read_Fst(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_17_read_Fst = {"_read_Fst", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_17_read_Fst, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_17_read_Fst(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_Fst (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3238, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3238, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_read_Fst", 0) < 0) __PYX_ERR(0, 3238, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_read_Fst", 1, 1, 1, i); __PYX_ERR(0, 3238, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3238, __pyx_L3_error)
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_read_Fst", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3238, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._read_Fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_16_read_Fst(__pyx_self, __pyx_v_source);

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

static PyObject *__pyx_pf_9pywrapfst_16_read_Fst(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_Fst", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst(__pyx_v_source, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3238, __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_Fst", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3248
 * 
 * 
 * cpdef Fst _read_Fst_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/

static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst__read_Fst_from_string(std::string __pyx_v_state, CYTHON_UNUSED int __pyx_skip_dispatch) {
  std::stringstream __pyx_v__sstrm;
  std::unique_ptr<fst::script::FstClass>  __pyx_v__tfst;
  struct __pyx_obj_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_Fst_from_string", 0);

  /* "pywrapfst.pyx":3250
 * cpdef Fst _read_Fst_from_string(string state):
 *   cdef stringstream _sstrm
 *   _sstrm << state             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:
*/
  (void)((__pyx_v__sstrm << __pyx_v_state));

  /* "pywrapfst.pyx":3252
 *   _sstrm << state
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _tfst = fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _tfst.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3253
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:
 *     _tfst = fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>")             # <<<<<<<<<<<<<<
 *   if _tfst.get() == NULL:
 *     raise FstIOError("Read from string failed")
*/
        __pyx_v__tfst = fst::script::FstClass::Read(__pyx_v__sstrm, __pyx_k_pywrapfst);
      }

      /* "pywrapfst.pyx":3252
 *   _sstrm << state
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _tfst = fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _tfst.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3254
 *   with nogil:
 *     _tfst = fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_XFst(_tfst.release())
*/
  __pyx_t_1 = (__pyx_v__tfst.get() == NULL);
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":3255
 *     _tfst = fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _tfst.get() == NULL:
 *     raise FstIOError("Read from string failed")             # <<<<<<<<<<<<<<
 *   return _init_XFst(_tfst.release())
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Read_from_string_failed};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3255, __pyx_L1_error)

    /* "pywrapfst.pyx":3254
 *   with nogil:
 *     _tfst = fst.FstClass.ReadStream(_sstrm, b"<pywrapfst>")
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstIOError("Read from string failed")
 *   return _init_XFst(_tfst.release())
*/
  }

  /* "pywrapfst.pyx":3256
 *   if _tfst.get() == NULL:
 *     raise FstIOError("Read from string failed")
 *   return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3256, __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":3248
 * 
 * 
 * cpdef Fst _read_Fst_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pywrapfst._read_Fst_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_19_read_Fst_from_string = {"_read_Fst_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_read_Fst_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_19_read_Fst_from_string(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  std::string __pyx_v_state;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_read_Fst_from_string (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3248, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3248, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_read_Fst_from_string", 0) < 0) __PYX_ERR(0, 3248, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_read_Fst_from_string", 1, 1, 1, i); __PYX_ERR(0, 3248, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3248, __pyx_L3_error)
    }
    __pyx_v_state = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(values[0]); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3248, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_read_Fst_from_string", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3248, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._read_Fst_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_18_read_Fst_from_string(__pyx_self, __PYX_STD_MOVE_IF_SUPPORTED(__pyx_v_state));

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

static PyObject *__pyx_pf_9pywrapfst_18_read_Fst_from_string(CYTHON_UNUSED PyObject *__pyx_self, std::string __pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_read_Fst_from_string", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__read_Fst_from_string(__pyx_v_state, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3248, __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_Fst_from_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3399
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<Arc at 0x{id(self):x}>"
 * 
*/

/* 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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":3400
 * 
 *   def __repr__(self):
 *     return f"<Arc at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, int64_t ilabel, int64_t olabel, weight, int64_t nextstate):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_Arc_at_0x;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3399
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<Arc at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3402
 *     return f"<Arc at 0x{id(self):x}>"
 * 
 *   def __init__(self, int64_t ilabel, int64_t olabel, weight, int64_t nextstate):             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*/

/* Python wrapper */
static int __pyx_pw_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) {
  int64_t __pyx_v_ilabel;
  int64_t __pyx_v_olabel;
  PyObject *__pyx_v_weight = 0;
  int64_t __pyx_v_nextstate;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ilabel,&__pyx_mstate_global->__pyx_n_u_olabel,&__pyx_mstate_global->__pyx_n_u_weight,&__pyx_mstate_global->__pyx_n_u_nextstate,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3402, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3402, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3402, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3402, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3402, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 3402, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, i); __PYX_ERR(0, 3402, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 4)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3402, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3402, __pyx_L3_error)
      values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3402, __pyx_L3_error)
      values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3402, __pyx_L3_error)
    }
    __pyx_v_ilabel = __Pyx_PyLong_As_int64_t(values[0]); if (unlikely((__pyx_v_ilabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3402, __pyx_L3_error)
    __pyx_v_olabel = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_olabel == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3402, __pyx_L3_error)
    __pyx_v_weight = values[2];
    __pyx_v_nextstate = __Pyx_PyLong_As_int64_t(values[3]); if (unlikely((__pyx_v_nextstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3402, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 3402, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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 */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pywrapfst_3Arc_2__init__(struct __pyx_obj_9pywrapfst_Arc *__pyx_v_self, int64_t __pyx_v_ilabel, int64_t __pyx_v_olabel, PyObject *__pyx_v_weight, int64_t __pyx_v_nextstate) {
  fst::script::WeightClass __pyx_v__weight;
  int __pyx_r;
  fst::script::WeightClass __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3403
 * 
 *   def __init__(self, int64_t ilabel, int64_t olabel, weight, int64_t nextstate):
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)             # <<<<<<<<<<<<<<
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 * 
*/
  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_one(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3403, __pyx_L1_error)
  __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":3404
 *   def __init__(self, int64_t ilabel, int64_t olabel, weight, int64_t nextstate):
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))             # <<<<<<<<<<<<<<
 * 
 *   cpdef Arc copy(self):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
    __PYX_ERR(0, 3404, __pyx_L1_error)
  }
  __pyx_v_self->_arc.reset(new fst::script::ArcClass(__pyx_v_ilabel, __pyx_v_olabel, __pyx_v__weight, __pyx_v_nextstate));

  /* "pywrapfst.pyx":3402
 *     return f"<Arc at 0x{id(self):x}>"
 * 
 *   def __init__(self, int64_t ilabel, int64_t olabel, weight, int64_t nextstate):             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_one(b"tropical", weight)
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
*/

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

/* "pywrapfst.pyx":3406
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 * 
 *   cpdef Arc copy(self):             # <<<<<<<<<<<<<<
 *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)
 * 
*/

static PyObject *__pyx_pw_9pywrapfst_3Arc_5copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Arc &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_copy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_3Arc_5copy)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst_Arc))))) __PYX_ERR(0, 3406, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3407
 * 
 *   cpdef Arc copy(self):
 *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)             # <<<<<<<<<<<<<<
 * 
 *   property ilabel:
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Arc);
  __pyx_t_4 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Arc); 
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_ilabel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_olabel); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_weight); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_nextstate); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = 1;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_t_3, __pyx_t_6, __pyx_t_7, __pyx_t_8};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (5-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3407, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3406
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 * 
 *   cpdef Arc copy(self):             # <<<<<<<<<<<<<<
 *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_3Arc_5copy = {"copy", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Arc_5copy, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_3Arc_5copy(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("copy", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("copy", __pyx_kwds); return NULL;}
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("copy", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_3Arc_copy(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3406, __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":3411
 *   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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pywrapfst.pyx":3412
 * 
 *     def __get__(self):
 *       return deref(self._arc).ilabel             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, int64_t 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, 3412, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyLong_From_int64_t((*__pyx_v_self->_arc).ilabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3411
 *   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":3414
 *       return deref(self._arc).ilabel
 * 
 *     def __set__(self, int64_t 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) {
  int64_t __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyLong_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3414, __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), ((int64_t)__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, int64_t __pyx_v_value) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3415
 * 
 *     def __set__(self, int64_t 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, 3415, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).ilabel = __pyx_v_value;

  /* "pywrapfst.pyx":3414
 *       return deref(self._arc).ilabel
 * 
 *     def __set__(self, int64_t 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:;
  return __pyx_r;
}

/* "pywrapfst.pyx":3419
 *   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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pywrapfst.pyx":3420
 * 
 *     def __get__(self):
 *       return deref(self._arc).olabel             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, int64_t 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, 3420, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyLong_From_int64_t((*__pyx_v_self->_arc).olabel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3419
 *   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":3422
 *       return deref(self._arc).olabel
 * 
 *     def __set__(self, int64_t 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) {
  int64_t __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyLong_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3422, __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), ((int64_t)__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, int64_t __pyx_v_value) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3423
 * 
 *     def __set__(self, int64_t 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, 3423, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).olabel = __pyx_v_value;

  /* "pywrapfst.pyx":3422
 *       return deref(self._arc).olabel
 * 
 *     def __set__(self, int64_t 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:;
  return __pyx_r;
}

/* "pywrapfst.pyx":3427
 *   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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pywrapfst.pyx":3428
 * 
 *     def __get__(self):
 *       cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *       _weight._weight.reset(new fst.WeightClass(deref(self._arc).weight))
 *       return _weight
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3428, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":3429
 *     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, 3429, __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, 3429, __pyx_L1_error)
  }
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass((*__pyx_v_self->_arc).weight));

  /* "pywrapfst.pyx":3430
 *       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":3427
 *   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":3432
 *       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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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;
  fst::script::WeightClass __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3433
 * 
 *     def __set__(self, weight):
 *       deref(self._arc).weight = _get_WeightClass_or_one(b"tropical", weight)             # <<<<<<<<<<<<<<
 * 
 *   property nextstate:
*/
  __pyx_t_1 = __pyx_f_9pywrapfst__get_WeightClass_or_one(__pyx_k_tropical, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3433, __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, 3433, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":3432
 *       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:;
  return __pyx_r;
}

/* "pywrapfst.pyx":3437
 *   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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "pywrapfst.pyx":3438
 * 
 *     def __get__(self):
 *       return deref(self._arc).nextstate             # <<<<<<<<<<<<<<
 * 
 *     def __set__(self, int64_t 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, 3438, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyLong_From_int64_t((*__pyx_v_self->_arc).nextstate); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3437
 *   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":3440
 *       return deref(self._arc).nextstate
 * 
 *     def __set__(self, int64_t 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) {
  int64_t __pyx_v_value;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyLong_As_int64_t(__pyx_arg_value); if (unlikely((__pyx_v_value == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3440, __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), ((int64_t)__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, int64_t __pyx_v_value) {
  int __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3441
 * 
 *     def __set__(self, int64_t 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, 3441, __pyx_L1_error)
  }
  (*__pyx_v_self->_arc).nextstate = __pyx_v_value;

  /* "pywrapfst.pyx":3440
 *       return deref(self._arc).nextstate
 * 
 *     def __set__(self, int64_t 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:;
  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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_3Arc_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Arc_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_3Arc_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._arc cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._arc cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__arc_cannot_be_converted_to, 0, 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_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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_3Arc_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Arc_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_3Arc_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Arc.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_3Arc_8__setstate_cython__(((struct __pyx_obj_9pywrapfst_Arc *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._arc cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._arc cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__arc_cannot_be_converted_to, 0, 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_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":3444
 * 
 * 
 * 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;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  size_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_Arc", 0);

  /* "pywrapfst.pyx":3445
 * 
 * cdef Arc _init_Arc(const fst.ArcClass &arc):
 *   cdef Weight _weight = Weight.__new__(Weight)             # <<<<<<<<<<<<<<
 *   _weight._weight.reset(new fst.WeightClass(arc.weight))
 *   return Arc(arc.ilabel, arc.olabel, _weight, arc.nextstate)
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_Weight(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3445, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v__weight = ((struct __pyx_obj_9pywrapfst_Weight *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":3446
 * 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, 3446, __pyx_L1_error)
  }
  __pyx_v__weight->_weight.reset(new fst::script::WeightClass(__pyx_v_arc.weight));

  /* "pywrapfst.pyx":3447
 *   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_2 = NULL;
  __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Arc);
  __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Arc); 
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_arc.ilabel); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyLong_From_int64_t(__pyx_v_arc.olabel); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyLong_From_int64_t(__pyx_v_arc.nextstate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = 1;
  {
    PyObject *__pyx_callargs[5] = {__pyx_t_2, __pyx_t_4, __pyx_t_5, ((PyObject *)__pyx_v__weight), __pyx_t_6};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_7, (5-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 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_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3447, __pyx_L1_error)
    __Pyx_GOTREF((PyObject *)__pyx_t_1);
  }
  __pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3444
 * 
 * 
 * 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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __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":3461
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_ArcIterator at 0x{id(self):x}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_1__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator___repr__(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator___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[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":3462
 * 
 *   def __repr__(self):
 *     return f"<_ArcIterator at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, Fst ifst, int64_t state):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_ArcIterator_at_0x;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 19 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3461
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_ArcIterator at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3464
 *     return f"<_ArcIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, Fst ifst, int64_t state):             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

/* Python wrapper */
static int __pyx_pw_9pywrapfst_12_ArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_12_ArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  int64_t __pyx_v_state;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3464, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3464, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 3464, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 3464, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3464, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3464, __pyx_L3_error)
    }
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_Fst *)values[0]);
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3464, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3464, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3464, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pywrapfst_12_ArcIterator_2__init__(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, int64_t __pyx_v_state) {
  bool __pyx_v__result;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  std::shared_ptr<fst::script::FstClass>  __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":3466
 *   def __init__(self, Fst ifst, int64_t state):
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3467
 *     cdef bool _result
 *     with nogil:
 *       _result = ifst._fst.get().ValidStateId(state)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIndexError("State index out of range")
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3467, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_ifst->_fst.get()->ValidStateId(__pyx_v_state);
      }

      /* "pywrapfst.pyx":3466
 *   def __init__(self, Fst ifst, int64_t state):
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3468
 *     with nogil:
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
*/
  __pyx_t_1 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":3469
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:
 *       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_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3469, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3469, __pyx_L1_error)

    /* "pywrapfst.pyx":3468
 *     with nogil:
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
*/
  }

  /* "pywrapfst.pyx":3471
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst             # <<<<<<<<<<<<<<
 *     self._it.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, 3471, __pyx_L1_error)
  }
  __pyx_t_6 = __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, 3471, __pyx_L1_error)
  }
  __pyx_v_self->_fst = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pywrapfst.pyx":3472
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
 *     self._it.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'", "_it");
    __PYX_ERR(0, 3472, __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, 3472, __pyx_L1_error)
  }
  __pyx_v_self->_it.reset(new fst::script::ArcIteratorClass((*__pyx_v_self->_fst), __pyx_v_state));

  /* "pywrapfst.pyx":3464
 *     return f"<_ArcIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, Fst ifst, int64_t state):             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

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

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

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

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

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

  /* "pywrapfst.pyx":3476
 *   # 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":3475
 * 
 *   # 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":3479
 * 
 *   # 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_12_ArcIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_7__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_6__next__(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_6__next__(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self) {
  struct __pyx_obj_9pywrapfst_Arc *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  bool __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pywrapfst.pyx":3480
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef Arc 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, 3480, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__ArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3480, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3481
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef Arc result = self._value()
 *     self.next()
*/
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

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

  /* "pywrapfst.pyx":3482
 *     if self.done():
 *       raise StopIteration
 *     cdef Arc 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, 3482, __pyx_L1_error)
  }
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst__ArcIterator *)__pyx_v_self->__pyx_vtab)->_value(__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pywrapfst.pyx":3483
 *       raise StopIteration
 *     cdef Arc 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, 3483, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__ArcIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3483, __pyx_L1_error)

  /* "pywrapfst.pyx":3484
 *     cdef Arc result = self._value()
 *     self.next()
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3479
 * 
 *   # 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_3);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("pywrapfst._ArcIterator.__next__", __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":3486
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
*/

static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static bool __pyx_f_9pywrapfst_12_ArcIterator_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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3486, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12_ArcIterator_9done)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3486, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3486, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3495
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._it.get().Done()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3496
 *     """
 *     with nogil:
 *       return self._it.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   def flags(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3496, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_it.get()->Done();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":3495
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._it.get().Done()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":3486
 *     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_AddTraceback("pywrapfst._ArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12_ArcIterator_8done, "\n    done(self)\n\n    Indicates whether the iterator is exhausted or not.\n\n    Returns:\n      True if the iterator is exhausted, False otherwise.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_9done = {"done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_9done, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_8done};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("done", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("done", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_8done(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_8done(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_12_ArcIterator_done(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3486, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3486, __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._ArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3498
 *       return self._it.get().Done()
 * 
 *   def flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_11flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12_ArcIterator_10flags, "\n    flags(self)\n\n    Returns the iterator's flags.\n\n    Returns:\n      A bitmask.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_11flags = {"flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_11flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_10flags};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_11flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("flags", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("flags", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_10flags(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_10flags(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self) {
  uint8_t __pyx_v__flags;
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flags", 0);

  /* "pywrapfst.pyx":3508
 *     """
 *     cdef uint8_t _flags
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _flags = self._it.get().Flags()
 *     return ArcIteratorFlags(_flags)
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3509
 *     cdef uint8_t _flags
 *     with nogil:
 *       _flags = self._it.get().Flags()             # <<<<<<<<<<<<<<
 *     return ArcIteratorFlags(_flags)
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3509, __pyx_L4_error)
        }
        __pyx_v__flags = __pyx_v_self->_it.get()->Flags();
      }

      /* "pywrapfst.pyx":3508
 *     """
 *     cdef uint8_t _flags
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _flags = self._it.get().Flags()
 *     return ArcIteratorFlags(_flags)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3510
 *     with nogil:
 *       _flags = self._it.get().Flags()
 *     return ArcIteratorFlags(_flags)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void next(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ArcIteratorFlags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_uint8_t(__pyx_v__flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3498
 *       return self._it.get().Done()
 * 
 *   def 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_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":3512
 *     return ArcIteratorFlags(_flags)
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
*/

static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_13next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_12_ArcIterator_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12_ArcIterator_13next)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3512, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3518
 *     Advances the iterator.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Next()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3519
 *     """
 *     with nogil:
 *       self._it.get().Next()             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t position(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3519, __pyx_L4_error)
        }
        __pyx_v_self->_it.get()->Next();
      }

      /* "pywrapfst.pyx":3518
 *     Advances the iterator.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Next()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3512
 *     return ArcIteratorFlags(_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_AddTraceback("pywrapfst._ArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_13next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12_ArcIterator_12next, "\n    next(self)\n\n    Advances the iterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_13next = {"next", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_13next, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_12next};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_13next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("next", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("next", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_12next(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_12next(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_12_ArcIterator_next(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3512, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3512, __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":3521
 *       self._it.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
*/

static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_15position(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_9pywrapfst_12_ArcIterator_position(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t __pyx_v__pos;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("position", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3521, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12_ArcIterator_15position)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3521, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3521, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3531
 *     """
 *     cdef size_t _pos
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _pos = self._it.get().Position()
 *     return _pos
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3532
 *     cdef size_t _pos
 *     with nogil:
 *       _pos = self._it.get().Position()             # <<<<<<<<<<<<<<
 *     return _pos
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3532, __pyx_L4_error)
        }
        __pyx_v__pos = __pyx_v_self->_it.get()->Position();
      }

      /* "pywrapfst.pyx":3531
 *     """
 *     cdef size_t _pos
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _pos = self._it.get().Position()
 *     return _pos
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3533
 *     with nogil:
 *       _pos = self._it.get().Position()
 *     return _pos             # <<<<<<<<<<<<<<
 * 
 *   cpdef void reset(self):
*/
  __pyx_r = __pyx_v__pos;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3521
 *       self._it.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_AddTraceback("pywrapfst._ArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_15position(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12_ArcIterator_14position, "\n    position(self)\n\n    Returns the position of the iterator.\n\n    Returns:\n      The iterator's position, expressed as an integer.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_15position = {"position", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_15position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_14position};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_15position(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("position (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("position", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("position", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_14position(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_14position(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("position", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_12_ArcIterator_position(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3521, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3521, __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._ArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3535
 *     return _pos
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
*/

static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_17reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_12_ArcIterator_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12_ArcIterator_17reset)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3535, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3541
 *     Resets the iterator to the initial position.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Reset()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3542
 *     """
 *     with nogil:
 *       self._it.get().Reset()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void seek(self, size_t a):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3542, __pyx_L4_error)
        }
        __pyx_v_self->_it.get()->Reset();
      }

      /* "pywrapfst.pyx":3541
 *     Resets the iterator to the initial position.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Reset()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3535
 *     return _pos
 * 
 *   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_AddTraceback("pywrapfst._ArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_17reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12_ArcIterator_16reset, "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_17reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_17reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_16reset};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_17reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_16reset(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_16reset(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_12_ArcIterator_reset(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3535, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3535, __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":3544
 *       self._it.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
*/

static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_19seek(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_12_ArcIterator_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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("seek", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_12_ArcIterator_19seek)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3544, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3544, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3553
 *       a: The position to seek to.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Seek(a)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3554
 *     """
 *     with nogil:
 *       self._it.get().Seek(a)             # <<<<<<<<<<<<<<
 * 
 *   def set_flags(self, flags, mask):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3554, __pyx_L4_error)
        }
        __pyx_v_self->_it.get()->Seek(__pyx_v_a);
      }

      /* "pywrapfst.pyx":3553
 *       a: The position to seek to.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Seek(a)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3544
 *       self._it.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_AddTraceback("pywrapfst._ArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_19seek(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12_ArcIterator_18seek, "\n    seek(self, a)\n\n    Advance the iterator to a new position.\n\n    Args:\n      a: The position to seek to.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_19seek = {"seek", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_19seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_18seek};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_19seek(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_a;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seek (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_a,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3544, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3544, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "seek", 0) < 0) __PYX_ERR(0, 3544, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("seek", 1, 1, 1, i); __PYX_ERR(0, 3544, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3544, __pyx_L3_error)
    }
    __pyx_v_a = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_a == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3544, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seek", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3544, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_12_ArcIterator_18seek(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self), __pyx_v_a);

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("seek", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_12_ArcIterator_seek(__pyx_v_self, __pyx_v_a, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3544, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3544, __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":3556
 *       self._it.get().Seek(a)
 * 
 *   def set_flags(self, flags, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_21set_flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12_ArcIterator_20set_flags, "\n    set_flags(self, flags, mask)\n\n    Sets the current iterator behavioral flags.\n\n    Args:\n      flags: The properties to be set.\n      mask: A mask to be applied to the `flags` argument before setting them.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_21set_flags = {"set_flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_21set_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_20set_flags};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_21set_flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_flags = 0;
  PyObject *__pyx_v_mask = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_flags (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_mask,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3556, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3556, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3556, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_flags", 0) < 0) __PYX_ERR(0, 3556, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, i); __PYX_ERR(0, 3556, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3556, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3556, __pyx_L3_error)
    }
    __pyx_v_flags = values[0];
    __pyx_v_mask = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3556, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_12_ArcIterator_20set_flags(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self), __pyx_v_flags, __pyx_v_mask);

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_20set_flags(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_mask) {
  uint8_t __pyx_v__flags;
  uint8_t __pyx_v__mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint8_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_flags", 0);

  /* "pywrapfst.pyx":3566
 *       mask: A mask to be applied to the `flags` argument before setting them.
 *     """
 *     cdef uint8_t _flags = flags.value             # <<<<<<<<<<<<<<
 *     cdef uint8_t _mask = mask.value
 *     with nogil:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3566, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__flags = __pyx_t_2;

  /* "pywrapfst.pyx":3567
 *     """
 *     cdef uint8_t _flags = flags.value
 *     cdef uint8_t _mask = mask.value             # <<<<<<<<<<<<<<
 *     with nogil:
 *       self._it.get().SetFlags(_flags, _mask)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__mask = __pyx_t_2;

  /* "pywrapfst.pyx":3568
 *     cdef uint8_t _flags = flags.value
 *     cdef uint8_t _mask = mask.value
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().SetFlags(_flags, _mask)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3569
 *     cdef uint8_t _mask = mask.value
 *     with nogil:
 *       self._it.get().SetFlags(_flags, _mask)             # <<<<<<<<<<<<<<
 * 
 *   cdef Arc _value(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3569, __pyx_L4_error)
        }
        __pyx_v_self->_it.get()->SetFlags(__pyx_v__flags, __pyx_v__mask);
      }

      /* "pywrapfst.pyx":3568
 *     cdef uint8_t _flags = flags.value
 *     cdef uint8_t _mask = mask.value
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().SetFlags(_flags, _mask)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3556
 *       self._it.get().Seek(a)
 * 
 *   def set_flags(self, flags, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
*/

  /* 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._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":3571
 *       self._it.get().SetFlags(_flags, _mask)
 * 
 *   cdef Arc _value(self):             # <<<<<<<<<<<<<<
 *     return _init_Arc(self._it.get().Value())
 * 
*/

static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_12_ArcIterator__value(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self) {
  struct __pyx_obj_9pywrapfst_Arc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_value", 0);

  /* "pywrapfst.pyx":3572
 * 
 *   cdef Arc _value(self):
 *     return _init_Arc(self._it.get().Value())             # <<<<<<<<<<<<<<
 * 
 *   def value(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
    __PYX_ERR(0, 3572, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_it.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3571
 *       self._it.get().SetFlags(_flags, _mask)
 * 
 *   cdef Arc _value(self):             # <<<<<<<<<<<<<<
 *     return _init_Arc(self._it.get().Value())
 * 
*/

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

/* "pywrapfst.pyx":3574
 *     return _init_Arc(self._it.get().Value())
 * 
 *   def value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_23value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_12_ArcIterator_22value, "\n    value(self)\n\n    Returns the current arc.\n\n    Returns:\n       The current arc.\n\n    Raises:\n      FstOpError: Can't get value from an exhausted iterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_23value = {"value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_23value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_22value};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_23value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("value", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("value", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_22value(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_22value(struct __pyx_obj_9pywrapfst__ArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 0);

  /* "pywrapfst.pyx":3586
 *       FstOpError: Can't get value from an exhausted iterator.
 *     """
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 3586, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__ArcIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3586, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3587
 *     """
 *     if self.done():
 *       raise FstOpError("Can't get value from an exhausted iterator")             # <<<<<<<<<<<<<<
 *     return self._value()
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Can_t_get_value_from_an_exhauste};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3587, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3587, __pyx_L1_error)

    /* "pywrapfst.pyx":3586
 *       FstOpError: Can't get value from an exhausted iterator.
 *     """
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()
*/
  }

  /* "pywrapfst.pyx":3588
 *     if self.done():
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_value");
    __PYX_ERR(0, 3588, __pyx_L1_error)
  }
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst__ArcIterator *)__pyx_v_self->__pyx_vtab)->_value(__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3574
 *     return _init_Arc(self._it.get().Value())
 * 
 *   def value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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._fst,self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_25__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_25__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_25__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_25__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_24__reduce_cython__(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__fst_self__it_cannot_be_con, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __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._fst,self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_27__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_12_ArcIterator_27__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_27__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_12_ArcIterator_27__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._ArcIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_12_ArcIterator_26__setstate_cython__(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_9pywrapfst_12_ArcIterator_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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__fst_self__it_cannot_be_con, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __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":3600
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_1__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator___repr__(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator___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[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":3601
 * 
 *   def __repr__(self):
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, MutableFst ifst, int64_t state):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_MutableArcIterator_at_0x;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 26 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3600
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3603
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, MutableFst ifst, int64_t state):             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

/* Python wrapper */
static int __pyx_pw_9pywrapfst_19_MutableArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_19_MutableArcIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_ifst = 0;
  int64_t __pyx_v_state;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3603, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3603, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3603, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 3603, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, i); __PYX_ERR(0, 3603, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3603, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3603, __pyx_L3_error)
    }
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_MutableFst *)values[0]);
    __pyx_v_state = __Pyx_PyLong_As_int64_t(values[1]); if (unlikely((__pyx_v_state == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3603, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3603, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, 1, "ifst", 0))) __PYX_ERR(0, 3603, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pywrapfst_19_MutableArcIterator_2__init__(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_MutableFst *__pyx_v_ifst, int64_t __pyx_v_state) {
  bool __pyx_v__result;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  std::shared_ptr<fst::script::MutableFstClass>  __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":3605
 *   def __init__(self, MutableFst ifst, int64_t state):
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3606
 *     cdef bool _result
 *     with nogil:
 *       _result = ifst._fst.get().ValidStateId(state)             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstIndexError("State index out of range")
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3606, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_ifst->__pyx_base._fst.get()->ValidStateId(__pyx_v_state);
      }

      /* "pywrapfst.pyx":3605
 *   def __init__(self, MutableFst ifst, int64_t state):
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3607
 *     with nogil:
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
*/
  __pyx_t_1 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":3608
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:
 *       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_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIndexError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_State_index_out_of_range};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3608, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 3608, __pyx_L1_error)

    /* "pywrapfst.pyx":3607
 *     with nogil:
 *       _result = ifst._fst.get().ValidStateId(state)
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
*/
  }

  /* "pywrapfst.pyx":3610
 *       raise FstIndexError("State index out of range")
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._mfst = ifst._mfst             # <<<<<<<<<<<<<<
 *     self._mit.reset(new fst.MutableArcIteratorClass(self._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, 3610, __pyx_L1_error)
  }
  __pyx_t_6 = __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, 3610, __pyx_L1_error)
  }
  __pyx_v_self->_mfst = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pywrapfst.pyx":3611
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._mfst = ifst._mfst
 *     self._mit.reset(new fst.MutableArcIteratorClass(self._mfst.get(), state))             # <<<<<<<<<<<<<<
 * 
 *   # A substantial portion of this is copy/paste from _ArcIterator, but we are at
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
    __PYX_ERR(0, 3611, __pyx_L1_error)
  }
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mfst");
    __PYX_ERR(0, 3611, __pyx_L1_error)
  }
  __pyx_v_self->_mit.reset(new fst::script::MutableArcIteratorClass(__pyx_v_self->_mfst.get(), __pyx_v_state));

  /* "pywrapfst.pyx":3603
 *     return f"<_MutableArcIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, MutableFst ifst, int64_t state):             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/

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

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

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

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

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

  /* "pywrapfst.pyx":3619
 *   # 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":3618
 * 
 *   # 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":3622
 * 
 *   # 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_19_MutableArcIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_7__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_6__next__(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_6__next__(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  struct __pyx_obj_9pywrapfst_Arc *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  bool __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pywrapfst.pyx":3623
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef Arc 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, 3623, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.done(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3623, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3624
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef Arc result = self._value()
 *     self.next()
*/
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

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

  /* "pywrapfst.pyx":3625
 *     if self.done():
 *       raise StopIteration
 *     cdef Arc 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, 3625, __pyx_L1_error)
  }
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._value(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3625, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "pywrapfst.pyx":3626
 *       raise StopIteration
 *     cdef Arc 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, 3626, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.next(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3626, __pyx_L1_error)

  /* "pywrapfst.pyx":3627
 *     cdef Arc result = self._value()
 *     self.next()
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_result);
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "pywrapfst.pyx":3622
 * 
 *   # 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_3);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("pywrapfst._MutableArcIterator.__next__", __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":3629
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
*/

static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static bool __pyx_f_9pywrapfst_19_MutableArcIterator_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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3629, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableArcIterator_9done)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3629, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3629, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3638
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._mit.get().Done()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3639
 *     """
 *     with nogil:
 *       return self._mit.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   def flags(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3639, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_mit.get()->Done();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":3638
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._mit.get().Done()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":3629
 *     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_AddTraceback("pywrapfst._MutableArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_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 PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_9done = {"done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_9done, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_8done};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("done", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("done", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_8done(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_8done(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_19_MutableArcIterator_done(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3629, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3629, __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._MutableArcIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3641
 *       return self._mit.get().Done()
 * 
 *   def flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_11flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_10flags, "\n    flags(self)\n\n    Returns the iterator's flags.\n\n    Returns:\n      A bitmask.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_11flags = {"flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_11flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_10flags};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_11flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flags (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("flags", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("flags", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_10flags(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_10flags(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  uint8_t __pyx_v__flags;
  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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("flags", 0);

  /* "pywrapfst.pyx":3651
 *     """
 *     cdef uint8_t _flags
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _flags = self._mit.get().Flags()
 *     return ArcIteratorFlags(_flags)
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3652
 *     cdef uint8_t _flags
 *     with nogil:
 *       _flags = self._mit.get().Flags()             # <<<<<<<<<<<<<<
 *     return ArcIteratorFlags(_flags)
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3652, __pyx_L4_error)
        }
        __pyx_v__flags = __pyx_v_self->_mit.get()->Flags();
      }

      /* "pywrapfst.pyx":3651
 *     """
 *     cdef uint8_t _flags
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _flags = self._mit.get().Flags()
 *     return ArcIteratorFlags(_flags)
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3653
 *     with nogil:
 *       _flags = self._mit.get().Flags()
 *     return ArcIteratorFlags(_flags)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void next(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = NULL;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_ArcIteratorFlags); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyLong_From_uint8_t(__pyx_v__flags); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3653, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = 1;
  #if CYTHON_UNPACK_METHODS
  if (unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    assert(__pyx_t_2);
    PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx__function);
    __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
    __pyx_t_5 = 0;
  }
  #endif
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_4};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    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;

  /* "pywrapfst.pyx":3641
 *       return self._mit.get().Done()
 * 
 *   def 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_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":3655
 *     return ArcIteratorFlags(_flags)
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
*/

static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_13next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_19_MutableArcIterator_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3655, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableArcIterator_13next)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3655, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3661
 *     Advances the iterator.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().Next()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3662
 *     """
 *     with nogil:
 *       self._mit.get().Next()             # <<<<<<<<<<<<<<
 * 
 *   cpdef size_t position(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3662, __pyx_L4_error)
        }
        __pyx_v_self->_mit.get()->Next();
      }

      /* "pywrapfst.pyx":3661
 *     Advances the iterator.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().Next()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3655
 *     return ArcIteratorFlags(_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_AddTraceback("pywrapfst._MutableArcIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_13next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_12next, "\n    next(self)\n\n    Advances the iterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_13next = {"next", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_13next, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_12next};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_13next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("next", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("next", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_12next(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_12next(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_19_MutableArcIterator_next(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3655, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3655, __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":3664
 *       self._mit.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
*/

static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_15position(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static size_t __pyx_f_9pywrapfst_19_MutableArcIterator_position(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  size_t __pyx_v__pos;
  size_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("position", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_position); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableArcIterator_15position)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3664, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_5 = __Pyx_PyLong_As_size_t(__pyx_t_2); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3664, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3674
 *     """
 *     cdef size_t _pos
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _pos = self._mit.get().Position()
 *     return _pos
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3675
 *     cdef size_t _pos
 *     with nogil:
 *       _pos = self._mit.get().Position()             # <<<<<<<<<<<<<<
 *     return _pos
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3675, __pyx_L4_error)
        }
        __pyx_v__pos = __pyx_v_self->_mit.get()->Position();
      }

      /* "pywrapfst.pyx":3674
 *     """
 *     cdef size_t _pos
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _pos = self._mit.get().Position()
 *     return _pos
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3676
 *     with nogil:
 *       _pos = self._mit.get().Position()
 *     return _pos             # <<<<<<<<<<<<<<
 * 
 *   cpdef void reset(self):
*/
  __pyx_r = __pyx_v__pos;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3664
 *       self._mit.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_AddTraceback("pywrapfst._MutableArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_15position(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_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 PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_15position = {"position", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_15position, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_14position};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_15position(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("position (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("position", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("position", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_14position(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_14position(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  size_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("position", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_19_MutableArcIterator_position(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3664, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3664, __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._MutableArcIterator.position", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":3678
 *     return _pos
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
*/

static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_17reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_19_MutableArcIterator_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3678, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableArcIterator_17reset)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3678, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3684
 *     Resets the iterator to the initial position.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().Reset()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3685
 *     """
 *     with nogil:
 *       self._mit.get().Reset()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void seek(self, size_t a):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3685, __pyx_L4_error)
        }
        __pyx_v_self->_mit.get()->Reset();
      }

      /* "pywrapfst.pyx":3684
 *     Resets the iterator to the initial position.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().Reset()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3678
 *     return _pos
 * 
 *   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_AddTraceback("pywrapfst._MutableArcIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_17reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_16reset, "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_17reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_17reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_16reset};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_17reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_16reset(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_16reset(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_19_MutableArcIterator_reset(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3678, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3678, __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":3687
 *       self._mit.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
*/

static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_19seek(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_19_MutableArcIterator_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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("seek", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_seek); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableArcIterator_19seek)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = __Pyx_PyLong_FromSize_t(__pyx_v_a); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3687, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_6 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_5};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3687, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3696
 *       a: The position to seek to.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().Seek(a)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3697
 *     """
 *     with nogil:
 *       self._mit.get().Seek(a)             # <<<<<<<<<<<<<<
 * 
 *   def set_flags(self, flags, mask):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3697, __pyx_L4_error)
        }
        __pyx_v_self->_mit.get()->Seek(__pyx_v_a);
      }

      /* "pywrapfst.pyx":3696
 *       a: The position to seek to.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().Seek(a)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3687
 *       self._mit.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_AddTraceback("pywrapfst._MutableArcIterator.seek", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_19seek(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_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 PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_19seek = {"seek", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_19seek, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_18seek};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_19seek(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  size_t __pyx_v_a;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("seek (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_a,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3687, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3687, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "seek", 0) < 0) __PYX_ERR(0, 3687, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("seek", 1, 1, 1, i); __PYX_ERR(0, 3687, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3687, __pyx_L3_error)
    }
    __pyx_v_a = __Pyx_PyLong_As_size_t(values[0]); if (unlikely((__pyx_v_a == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 3687, __pyx_L3_error)
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("seek", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3687, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_19_MutableArcIterator_18seek(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self), __pyx_v_a);

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_18seek(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, size_t __pyx_v_a) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("seek", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_19_MutableArcIterator_seek(__pyx_v_self, __pyx_v_a, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3687, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3687, __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":3699
 *       self._mit.get().Seek(a)
 * 
 *   def set_flags(self, flags, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_21set_flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_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 PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_21set_flags = {"set_flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_21set_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_20set_flags};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_21set_flags(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_flags = 0;
  PyObject *__pyx_v_mask = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_flags (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_flags,&__pyx_mstate_global->__pyx_n_u_mask,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3699, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3699, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3699, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_flags", 0) < 0) __PYX_ERR(0, 3699, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, i); __PYX_ERR(0, 3699, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3699, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3699, __pyx_L3_error)
    }
    __pyx_v_flags = values[0];
    __pyx_v_mask = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_flags", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 3699, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_19_MutableArcIterator_20set_flags(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self), __pyx_v_flags, __pyx_v_mask);

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_20set_flags(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_mask) {
  uint8_t __pyx_v__flags;
  uint8_t __pyx_v__mask;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  uint8_t __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_flags", 0);

  /* "pywrapfst.pyx":3709
 *       mask: A mask to be applied to the `flags` argument before setting them.
 *     """
 *     cdef uint8_t _flags = flags.value             # <<<<<<<<<<<<<<
 *     cdef uint8_t _mask = mask.value
 *     with nogil:
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__flags = __pyx_t_2;

  /* "pywrapfst.pyx":3710
 *     """
 *     cdef uint8_t _flags = flags.value
 *     cdef uint8_t _mask = mask.value             # <<<<<<<<<<<<<<
 *     with nogil:
 *       self._mit.get().SetFlags(_flags, _mask)
*/
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_mask, __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_As_uint8_t(__pyx_t_1); if (unlikely((__pyx_t_2 == ((uint8_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3710, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__mask = __pyx_t_2;

  /* "pywrapfst.pyx":3711
 *     cdef uint8_t _flags = flags.value
 *     cdef uint8_t _mask = mask.value
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().SetFlags(_flags, _mask)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3712
 *     cdef uint8_t _mask = mask.value
 *     with nogil:
 *       self._mit.get().SetFlags(_flags, _mask)             # <<<<<<<<<<<<<<
 * 
 *   cpdef void set_value(self, Arc arc) except *:
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3712, __pyx_L4_error)
        }
        __pyx_v_self->_mit.get()->SetFlags(__pyx_v__flags, __pyx_v__mask);
      }

      /* "pywrapfst.pyx":3711
 *     cdef uint8_t _flags = flags.value
 *     cdef uint8_t _mask = mask.value
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().SetFlags(_flags, _mask)
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3699
 *       self._mit.get().Seek(a)
 * 
 *   def set_flags(self, flags, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
*/

  /* 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._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":3714
 *       self._mit.get().SetFlags(_flags, _mask)
 * 
 *   cpdef void set_value(self, Arc arc) except *:             # <<<<<<<<<<<<<<
 *     """
 *     set_value(self, arc)
*/

static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_23set_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_19_MutableArcIterator_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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_set_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3714, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_19_MutableArcIterator_23set_value)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, ((PyObject *)__pyx_v_arc)};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3714, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3726
 *       FstOpError: Can't set value on an exhausted iterator.
 *     """
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise FstOpError("Can't set value on an exhausted iterator")
 *     with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 3726, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.done(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3726, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":3727
 *     """
 *     if self.done():
 *       raise FstOpError("Can't set value on an exhausted iterator")             # <<<<<<<<<<<<<<
 *     with nogil:
 *       self._mit.get().SetValue(deref(arc._arc))
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3727, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Can_t_set_value_on_an_exhausted};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 3727, __pyx_L1_error)

    /* "pywrapfst.pyx":3726
 *       FstOpError: Can't set value on an exhausted iterator.
 *     """
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise FstOpError("Can't set value on an exhausted iterator")
 *     with nogil:
*/
  }

  /* "pywrapfst.pyx":3728
 *     if self.done():
 *       raise FstOpError("Can't set value on an exhausted iterator")
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().SetValue(deref(arc._arc))
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3729
 *       raise FstOpError("Can't set value on an exhausted iterator")
 *     with nogil:
 *       self._mit.get().SetValue(deref(arc._arc))             # <<<<<<<<<<<<<<
 * 
 *   cdef Arc _value(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3729, __pyx_L5_error)
        }
        if (unlikely(((PyObject *)__pyx_v_arc) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3729, __pyx_L5_error)
        }
        __pyx_v_self->_mit.get()->SetValue((*__pyx_v_arc->_arc));
      }

      /* "pywrapfst.pyx":3728
 *     if self.done():
 *       raise FstOpError("Can't set value on an exhausted iterator")
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._mit.get().SetValue(deref(arc._arc))
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pywrapfst.pyx":3714
 *       self._mit.get().SetFlags(_flags, _mask)
 * 
 *   cpdef void set_value(self, Arc arc) except *:             # <<<<<<<<<<<<<<
 *     """
 *     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_AddTraceback("pywrapfst._MutableArcIterator.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_23set_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_22set_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\n    Raises:\n      FstOpError: Can't set value on an exhausted iterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_23set_value = {"set_value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_23set_value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_22set_value};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_23set_value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Arc *__pyx_v_arc = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_arc,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3714, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3714, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "set_value", 0) < 0) __PYX_ERR(0, 3714, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("set_value", 1, 1, 1, i); __PYX_ERR(0, 3714, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3714, __pyx_L3_error)
    }
    __pyx_v_arc = ((struct __pyx_obj_9pywrapfst_Arc *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_value", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3714, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._MutableArcIterator.set_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Arc, 1, "arc", 0))) __PYX_ERR(0, 3714, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_22set_value(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self), __pyx_v_arc);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_22set_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_19_MutableArcIterator_set_value(__pyx_v_self, __pyx_v_arc, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3714, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3714, __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":3731
 *       self._mit.get().SetValue(deref(arc._arc))
 * 
 *   cdef Arc _value(self):             # <<<<<<<<<<<<<<
 *     return _init_Arc(self._mit.get().Value())
 * 
*/

static struct __pyx_obj_9pywrapfst_Arc *__pyx_f_9pywrapfst_19_MutableArcIterator__value(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  struct __pyx_obj_9pywrapfst_Arc *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_value", 0);

  /* "pywrapfst.pyx":3732
 * 
 *   cdef Arc _value(self):
 *     return _init_Arc(self._mit.get().Value())             # <<<<<<<<<<<<<<
 * 
 *   def value(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_mit");
    __PYX_ERR(0, 3732, __pyx_L1_error)
  }
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_Arc(__pyx_v_self->_mit.get()->Value())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_9pywrapfst_Arc *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3731
 *       self._mit.get().SetValue(deref(arc._arc))
 * 
 *   cdef Arc _value(self):             # <<<<<<<<<<<<<<
 *     return _init_Arc(self._mit.get().Value())
 * 
*/

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

/* "pywrapfst.pyx":3734
 *     return _init_Arc(self._mit.get().Value())
 * 
 *   def value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_25value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_19_MutableArcIterator_24value, "\n    value(self)\n\n    Returns the current arc.\n\n    Returns:\n       The current arc.\n\n    Raises:\n      FstOpError: Can't get value from an exhausted iterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_25value = {"value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_25value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_24value};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_25value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("value", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("value", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_24value(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_24value(struct __pyx_obj_9pywrapfst__MutableArcIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 0);

  /* "pywrapfst.pyx":3746
 *       FstOpError: Can't get value from an exhausted iterator.
 *     """
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 3746, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.done(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3746, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3747
 *     """
 *     if self.done():
 *       raise FstOpError("Can't get value from an exhausted iterator")             # <<<<<<<<<<<<<<
 *     return self._value()
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_6 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_kp_u_Can_t_get_value_from_an_exhauste};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3747, __pyx_L1_error)

    /* "pywrapfst.pyx":3746
 *       FstOpError: Can't get value from an exhausted iterator.
 *     """
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()
*/
  }

  /* "pywrapfst.pyx":3748
 *     if self.done():
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_value");
    __PYX_ERR(0, 3748, __pyx_L1_error)
  }
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._value(((struct __pyx_obj_9pywrapfst__ArcIterator *)__pyx_v_self))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3748, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3734
 *     return _init_Arc(self._mit.get().Value())
 * 
 *   def value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __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._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_27__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_27__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_27__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_27__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_26__reduce_cython__(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__fst_self__it_self__mfst_se, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __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._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_29__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_19_MutableArcIterator_29__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_29__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_19_MutableArcIterator_29__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._MutableArcIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_19_MutableArcIterator_28__setstate_cython__(((struct __pyx_obj_9pywrapfst__MutableArcIterator *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_9pywrapfst_19_MutableArcIterator_28__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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__fst_self__it_self__mfst_se, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __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":3762
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_StateIterator at 0x{id(self):x}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_1__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator___repr__(((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_14_StateIterator___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[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":3763
 * 
 *   def __repr__(self):
 *     return f"<_StateIterator at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   def __init__(self, Fst ifst):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Format(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3[0] = __pyx_mstate_global->__pyx_kp_u_StateIterator_at_0x;
  __pyx_t_3[1] = __pyx_t_2;
  __pyx_t_3[2] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_1 = __Pyx_PyUnicode_Join(__pyx_t_3, 3, 21 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 1, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3762
 *   """
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<_StateIterator at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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":3765
 *     return f"<_StateIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, Fst ifst):             # <<<<<<<<<<<<<<
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
*/

/* Python wrapper */
static int __pyx_pw_9pywrapfst_14_StateIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9pywrapfst_14_StateIterator_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3765, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3765, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 3765, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, i); __PYX_ERR(0, 3765, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3765, __pyx_L3_error)
    }
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_Fst *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 3765, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3765, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator_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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pywrapfst_14_StateIterator_2__init__(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst) {
  int __pyx_r;
  std::shared_ptr<fst::script::FstClass>  __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3767
 *   def __init__(self, Fst ifst):
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst             # <<<<<<<<<<<<<<
 *     self._it.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, 3767, __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, 3767, __pyx_L1_error)
  }
  __pyx_v_self->_fst = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":3768
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
 *     self._it.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'", "_it");
    __PYX_ERR(0, 3768, __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, 3768, __pyx_L1_error)
  }
  __pyx_v_self->_it.reset(new fst::script::StateIteratorClass((*__pyx_v_self->_fst)));

  /* "pywrapfst.pyx":3765
 *     return f"<_StateIterator at 0x{id(self):x}>"
 * 
 *   def __init__(self, Fst ifst):             # <<<<<<<<<<<<<<
 *     # Makes copy of the shared_ptr, potentially extending the FST's lifetime.
 *     self._fst = ifst._fst
*/

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

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

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

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

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

  /* "pywrapfst.pyx":3772
 *   # 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":3771
 * 
 *   # 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":3775
 * 
 *   # 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_14_StateIterator_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_7__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator_6__next__(((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_6__next__(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self) {
  int64_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  bool __pyx_t_1;
  int __pyx_t_2;
  int64_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pywrapfst.pyx":3776
 *   # Magic method used to get a Pythonic API out of the C++ API.
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef int64_t 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, 3776, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst__StateIterator *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3776, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3777
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef int64_t result = self.value()
 *     self.next()
*/
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

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

  /* "pywrapfst.pyx":3778
 *     if self.done():
 *       raise StopIteration
 *     cdef int64_t 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, 3778, __pyx_L1_error)
  }
  __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst__StateIterator *)__pyx_v_self->__pyx_vtab)->value(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3778, __pyx_L1_error)
  __pyx_v_result = __pyx_t_3;

  /* "pywrapfst.pyx":3779
 *       raise StopIteration
 *     cdef int64_t 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, 3779, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst__StateIterator *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3779, __pyx_L1_error)

  /* "pywrapfst.pyx":3780
 *     cdef int64_t result = self.value()
 *     self.next()
 *     return result             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __Pyx_PyLong_From_int64_t(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3775
 * 
 *   # 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_4);
  if (!__pyx_error_without_exception) {
    __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":3782
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
*/

static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static bool __pyx_f_9pywrapfst_14_StateIterator_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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_14_StateIterator_9done)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3782, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3782, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3791
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._it.get().Done()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3792
 *     """
 *     with nogil:
 *       return self._it.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void next(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3792, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_it.get()->Done();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":3791
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._it.get().Done()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":3782
 *     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_AddTraceback("pywrapfst._StateIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_14_StateIterator_8done, "\n    done(self)\n\n    Indicates whether the iterator is exhausted or not.\n\n    Returns:\n      True if the iterator is exhausted, False otherwise.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_14_StateIterator_9done = {"done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_14_StateIterator_9done, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_14_StateIterator_8done};
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("done", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("done", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator_8done(((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_8done(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_14_StateIterator_done(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3782, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3782, __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._StateIterator.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_11next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_14_StateIterator_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3794, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_14_StateIterator_11next)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3794, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3800
 *     Advances the iterator.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Next()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3801
 *     """
 *     with nogil:
 *       self._it.get().Next()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void reset(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3801, __pyx_L4_error)
        }
        __pyx_v_self->_it.get()->Next();
      }

      /* "pywrapfst.pyx":3800
 *     Advances the iterator.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Next()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3794
 *       return self._it.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_AddTraceback("pywrapfst._StateIterator.next", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_11next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_14_StateIterator_10next, "\n    next(self)\n\n    Advances the iterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_14_StateIterator_11next = {"next", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_14_StateIterator_11next, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_14_StateIterator_10next};
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_11next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("next", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("next", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator_10next(((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_10next(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_14_StateIterator_next(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3794, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3794, __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":3803
 *       self._it.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
*/

static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_13reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_14_StateIterator_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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3803, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_14_StateIterator_13reset)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3803, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3809
 *     Resets the iterator to the initial position.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Reset()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3810
 *     """
 *     with nogil:
 *       self._it.get().Reset()             # <<<<<<<<<<<<<<
 * 
 *   cdef int64_t _value(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3810, __pyx_L4_error)
        }
        __pyx_v_self->_it.get()->Reset();
      }

      /* "pywrapfst.pyx":3809
 *     Resets the iterator to the initial position.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._it.get().Reset()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3803
 *       self._it.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_AddTraceback("pywrapfst._StateIterator.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_13reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_14_StateIterator_12reset, "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_14_StateIterator_13reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_14_StateIterator_13reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_14_StateIterator_12reset};
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_13reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator_12reset(((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_12reset(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_14_StateIterator_reset(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3803, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3803, __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":3812
 *       self._it.get().Reset()
 * 
 *   cdef int64_t _value(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       return self._it.get().Value()
*/

static int64_t __pyx_f_9pywrapfst_14_StateIterator__value(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self) {
  int64_t __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":3813
 * 
 *   cdef int64_t _value(self):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._it.get().Value()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3814
 *   cdef int64_t _value(self):
 *     with nogil:
 *       return self._it.get().Value()             # <<<<<<<<<<<<<<
 * 
 *   cpdef int64_t value(self) except *:
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3814, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_it.get()->Value();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":3813
 * 
 *   cdef int64_t _value(self):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._it.get().Value()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":3812
 *       self._it.get().Reset()
 * 
 *   cdef int64_t _value(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       return self._it.get().Value()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._StateIterator._value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  return __pyx_r;
}

/* "pywrapfst.pyx":3816
 *       return self._it.get().Value()
 * 
 *   cpdef int64_t value(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
*/

static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_15value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static int64_t __pyx_f_9pywrapfst_14_StateIterator_value(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self, int __pyx_skip_dispatch) {
  int64_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;
  int64_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_14_StateIterator_15value)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3816, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyLong_As_int64_t(__pyx_t_2); if (unlikely((__pyx_t_6 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3816, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":3828
 *       FstOpError: Can't get value from an exhausted iterator.
 *     """
 *     if self._it.get().Done():             # <<<<<<<<<<<<<<
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_it");
    __PYX_ERR(0, 3828, __pyx_L1_error)
  }
  __pyx_t_7 = (__pyx_v_self->_it.get()->Done() != 0);
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":3829
 *     """
 *     if self._it.get().Done():
 *       raise FstOpError("Can't get value from an exhausted iterator")             # <<<<<<<<<<<<<<
 *     return self._value()
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 3829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Can_t_get_value_from_an_exhauste};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3829, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 3829, __pyx_L1_error)

    /* "pywrapfst.pyx":3828
 *       FstOpError: Can't get value from an exhausted iterator.
 *     """
 *     if self._it.get().Done():             # <<<<<<<<<<<<<<
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()
*/
  }

  /* "pywrapfst.pyx":3830
 *     if self._it.get().Done():
 *       raise FstOpError("Can't get value from an exhausted iterator")
 *     return self._value()             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_value");
    __PYX_ERR(0, 3830, __pyx_L1_error)
  }
  __pyx_t_6 = ((struct __pyx_vtabstruct_9pywrapfst__StateIterator *)__pyx_v_self->__pyx_vtab)->_value(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3830, __pyx_L1_error)
  __pyx_r = __pyx_t_6;
  goto __pyx_L0;

  /* "pywrapfst.pyx":3816
 *       return self._it.get().Value()
 * 
 *   cpdef int64_t value(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     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._StateIterator.value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_15value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_14_StateIterator_14value, "\n    value(self)\n\n    Returns the current state.\n\n    Returns:\n       The current state.\n\n    Raises:\n      FstOpError: Can't get value from an exhausted iterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_14_StateIterator_15value = {"value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_14_StateIterator_15value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_14_StateIterator_14value};
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_15value(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("value (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("value", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("value", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator_14value(((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_14value(struct __pyx_obj_9pywrapfst__StateIterator *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int64_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("value", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_14_StateIterator_value(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3816, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3816, __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._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._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_14_StateIterator_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_14_StateIterator_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator_16__reduce_cython__(((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_v_self));

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

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

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__fst_self__it_cannot_be_con, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __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._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_14_StateIterator_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_14_StateIterator_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_14_StateIterator_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst._StateIterator.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_14_StateIterator_18__setstate_cython__(((struct __pyx_obj_9pywrapfst__StateIterator *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_9pywrapfst_14_StateIterator_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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__fst_self__it_cannot_be_con, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

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

  /* function exit code */
  __pyx_L1_error:;
  __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":3836
 * 
 * 
 * cdef Fst _map(Fst ifst,             # <<<<<<<<<<<<<<
 *                float delta=fst.kDelta,
 *                map_type="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_mstate_global->__pyx_k__19;
  PyObject *__pyx_v_map_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_identity);
  double __pyx_v_power = ((double)1.);

  /* "pywrapfst.pyx":3840
 *                map_type="identity",
 *                double power=1.,
 *                weight=None):             # <<<<<<<<<<<<<<
 *   cdef fst.MapType _map_type
 *   if not fst.GetMapType(tostring(map_type), addr(_map_type)):
*/
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  fst::script::MapType __pyx_v__map_type;
  fst::script::WeightClass __pyx_v__weight;
  std::unique_ptr<fst::script::FstClass>  __pyx_v_result;
  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;
  size_t __pyx_t_8;
  fst::script::WeightClass __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_map_type = __pyx_optional_args->map_type;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_power = __pyx_optional_args->power;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_weight = __pyx_optional_args->weight;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3842
 *                weight=None):
 *   cdef fst.MapType _map_type
 *   if not fst.GetMapType(tostring(map_type), addr(_map_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown map type: {map_type!r}")
 *   cdef fst.WeightClass _weight
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_map_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3842, __pyx_L1_error)
  __pyx_t_2 = (!(fst::script::GetMapType(__pyx_t_1, (&__pyx_v__map_type)) != 0));
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3843
 *   cdef fst.MapType _map_type
 *   if not fst.GetMapType(tostring(map_type), addr(_map_type)):
 *     raise FstArgError(f"Unknown map type: {map_type!r}")             # <<<<<<<<<<<<<<
 *   cdef fst.WeightClass _weight
 *   if _map_type == fst.MapType.TIMES_MAPPER:
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_map_type), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_map_type, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_8 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_8, (2-__pyx_t_8) | (__pyx_t_8*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3843, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3843, __pyx_L1_error)

    /* "pywrapfst.pyx":3842
 *                weight=None):
 *   cdef fst.MapType _map_type
 *   if not fst.GetMapType(tostring(map_type), addr(_map_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown map type: {map_type!r}")
 *   cdef fst.WeightClass _weight
*/
  }

  /* "pywrapfst.pyx":3845
 *     raise FstArgError(f"Unknown map type: {map_type!r}")
 *   cdef fst.WeightClass _weight
 *   if _map_type == fst.MapType.TIMES_MAPPER:             # <<<<<<<<<<<<<<
 *       _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
 *   else:
*/
  __pyx_t_2 = (__pyx_v__map_type == fst::script::MapType::TIMES);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":3846
 *   cdef fst.WeightClass _weight
 *   if _map_type == fst.MapType.TIMES_MAPPER:
 *       _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
 *   else:
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
*/
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
      __PYX_ERR(0, 3846, __pyx_L1_error)
    }
    __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3846, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_9pywrapfst__get_WeightClass_or_one(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3846, __pyx_L1_error)
    __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);

    /* "pywrapfst.pyx":3845
 *     raise FstArgError(f"Unknown map type: {map_type!r}")
 *   cdef fst.WeightClass _weight
 *   if _map_type == fst.MapType.TIMES_MAPPER:             # <<<<<<<<<<<<<<
 *       _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
 *   else:
*/
    goto __pyx_L4;
  }

  /* "pywrapfst.pyx":3848
 *       _weight = _get_WeightClass_or_one(ifst.weight_type(), weight)
 *   else:
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] result
 *   with nogil:
*/
  /*else*/ {
    if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
      __PYX_ERR(0, 3848, __pyx_L1_error)
    }
    __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L1_error)
    __pyx_t_9 = __pyx_f_9pywrapfst__get_WeightClass_or_zero(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3848, __pyx_L1_error)
    __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_9);
  }
  __pyx_L4:;

  /* "pywrapfst.pyx":3850
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
 *   cdef unique_ptr[fst.FstClass] result
 *   with nogil:             # <<<<<<<<<<<<<<
 *     result = fst.Map(deref(ifst._fst), _map_type, delta, power, _weight)
 *   return _init_XFst(result.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3851
 *   cdef unique_ptr[fst.FstClass] result
 *   with nogil:
 *     result = fst.Map(deref(ifst._fst), _map_type, delta, power, _weight)             # <<<<<<<<<<<<<<
 *   return _init_XFst(result.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3851, __pyx_L6_error)
        }
        __pyx_v_result = fst::script::Map((*__pyx_v_ifst->_fst), __pyx_v__map_type, __pyx_v_delta, __pyx_v_power, __pyx_v__weight);
      }

      /* "pywrapfst.pyx":3850
 *       _weight = _get_WeightClass_or_zero(ifst.weight_type(), weight)
 *   cdef unique_ptr[fst.FstClass] result
 *   with nogil:             # <<<<<<<<<<<<<<
 *     result = fst.Map(deref(ifst._fst), _map_type, delta, power, _weight)
 *   return _init_XFst(result.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L7;
        }
        __pyx_L6_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L7:;
      }
  }

  /* "pywrapfst.pyx":3852
 *   with nogil:
 *     result = fst.Map(deref(ifst._fst), _map_type, delta, power, _weight)
 *   return _init_XFst(result.release())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v_result.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3852, __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":3836
 * 
 * 
 * cdef Fst _map(Fst ifst,             # <<<<<<<<<<<<<<
 *                float delta=fst.kDelta,
 *                map_type="identity",
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __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":3855
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
*/

static PyObject *__pyx_pw_9pywrapfst_21arcmap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__20;
  PyObject *__pyx_v_map_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_identity);
  double __pyx_v_power = ((double)1.);

  /* "pywrapfst.pyx":3859
 *                  map_type="identity",
 *                  double power=1.,
 *                  weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   arcmap(ifst, delta=0.0009765625, map_type="identity", power=1., weight=None)
*/
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  struct __pyx_obj_9pywrapfst_Fst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst__map __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcmap", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_map_type = __pyx_optional_args->map_type;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_power = __pyx_optional_args->power;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_weight = __pyx_optional_args->weight;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":3899
 *     FstArgError: Unknown map type.
 *   """
 *   return _map(ifst, delta, map_type, power, weight)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.map_type = __pyx_v_map_type;
  __pyx_t_2.power = __pyx_v_power;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3899, __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":3855
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("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_21arcmap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_20arcmap, "\n  arcmap(ifst, delta=0.0009765625, map_type=\"identity\", power=1., weight=None)\n\n  Constructively applies a transform to all arcs and final states.\n\n  This operation transforms each arc and final state in the input FST using\n  one of the following:\n\n    * identity: maps to self.\n    * input_epsilon: replaces all input labels with epsilon.\n    * invert: reciprocates all non-Zero weights.\n    * output_epsilon: replaces all output labels with epsilon.\n    * quantize: quantizes weights.\n    * plus: adds a constant to all weights.\n    * power: raises all weights to a power.\n    * rmweight: replaces all non-Zero weights with 1.\n    * superfinal: redirects final states to a new superfinal state.\n    * times: right-multiplies a constant by all weights.\n    * to_log: converts weights to the log semiring.\n    * to_log64: converts weights to the log64 semiring.\n    * to_std: converts weights to the tropical semiring.\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta (ignored unless `map_type` is\n        `quantize`).\n    map_type: A string matching a known mapping operation (see above).\n    power: A positive scalar or integer power; ignored unless `map_type` is\n        `power` (in which case it defaults to 1).\n    weight: A Weight or weight string passed to the arc-mapper; ignored unless\n        `map_type` is `plus` (in which case it defaults to semiring Zero) or\n        `times` (in which case it defaults to semiring One).\n\n  Returns:\n    An FST with arcs and final states remapped.\n\n  Raises:\n    FstArgError: Unknown map type.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_21arcmap = {"arcmap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_21arcmap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_20arcmap};
static PyObject *__pyx_pw_9pywrapfst_21arcmap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arcmap (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_map_type,&__pyx_mstate_global->__pyx_n_u_power,&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3855, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "arcmap", 0) < 0) __PYX_ERR(0, 3855, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_identity));

      /* "pywrapfst.pyx":3859
 *                  map_type="identity",
 *                  double power=1.,
 *                  weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   arcmap(ifst, delta=0.0009765625, map_type="identity", power=1., weight=None)
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 5, i); __PYX_ERR(0, 3855, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3855, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3855, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_identity));
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3856, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__20;
    }
    __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, 3858, __pyx_L3_error)
    } else {
      __pyx_v_power = ((double)1.);
    }
    __pyx_v_weight = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("arcmap", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 3855, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3855, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_20arcmap(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_map_type, __pyx_v_power, __pyx_v_weight);

  /* "pywrapfst.pyx":3855
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_20arcmap(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arcmap", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.map_type = __pyx_v_map_type;
  __pyx_t_2.power = __pyx_v_power;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_arcmap(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3855, __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":3902
 * 
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter="auto",
*/

static PyObject *__pyx_pw_9pywrapfst_23compose(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_n_u_auto);

  /* "pywrapfst.pyx":3905
 *                          Fst ifst2,
 *                          compose_filter="auto",
 *                          bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   compose(ifst1, ifst2, compose_filter="auto", connect=True)
*/
  bool __pyx_v_connect = ((bool)1);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  std::unique_ptr<fst::ComposeOptions>  __pyx_v__opts;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compose", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_connect = __pyx_optional_args->connect;
      }
    }
  }

  /* "pywrapfst.pyx":3929
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(
*/
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 3929, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3929, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":3933
 *   _opts.reset(
 *       new fst.ComposeOptions(connect,
 *                              _get_compose_filter(tostring(compose_filter))))             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.Compose(deref(ifst1._fst.get()),
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3933, __pyx_L1_error)

  /* "pywrapfst.pyx":3931
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.ComposeOptions(connect,
 *                              _get_compose_filter(tostring(compose_filter))))
*/
  __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "pywrapfst.pyx":3934
 *       new fst.ComposeOptions(connect,
 *                              _get_compose_filter(tostring(compose_filter))))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Compose(deref(ifst1._fst.get()),
 *                 deref(ifst2._fst.get()),
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3935
 *                              _get_compose_filter(tostring(compose_filter))))
 *   with nogil:
 *     fst.Compose(deref(ifst1._fst.get()),             # <<<<<<<<<<<<<<
 *                 deref(ifst2._fst.get()),
 *                 _tfst.get(),
*/
        if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3935, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":3936
 *   with nogil:
 *     fst.Compose(deref(ifst1._fst.get()),
 *                 deref(ifst2._fst.get()),             # <<<<<<<<<<<<<<
 *                 _tfst.get(),
 *                 deref(_opts.get()))
*/
        if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3936, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":3935
 *                              _get_compose_filter(tostring(compose_filter))))
 *   with nogil:
 *     fst.Compose(deref(ifst1._fst.get()),             # <<<<<<<<<<<<<<
 *                 deref(ifst2._fst.get()),
 *                 _tfst.get(),
*/
        fst::script::Compose((*__pyx_v_ifst1->_fst.get()), (*__pyx_v_ifst2->_fst.get()), __pyx_v__tfst.get(), (*__pyx_v__opts.get()));
      }

      /* "pywrapfst.pyx":3934
 *       new fst.ComposeOptions(connect,
 *                              _get_compose_filter(tostring(compose_filter))))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Compose(deref(ifst1._fst.get()),
 *                 deref(ifst2._fst.get()),
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3939
 *                 _tfst.get(),
 *                 deref(_opts.get()))
 *   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, 3939, __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":3902
 * 
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter="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_23compose(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_22compose, "\n  compose(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n  Constructively composes two FSTs.\n\n  This operation computes the composition of two FSTs. If A transduces string\n  x to y with weight a and B transduces y to z with weight b, then their\n  composition transduces string x to z with weight a \\otimes b. The output\n  labels of the first transducer or the input labels of the second transducer\n  must be sorted (or otherwise support appropriate matchers).\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    compose_filter: A string matching a known composition filter; one of:\n        \"alt_sequence\", \"auto\", \"match\", \"no_match\", \"null\", \"sequence\",\n        \"trivial\".\n    connect: Should output be trimmed?\n\n  Returns:\n    An FST.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_23compose = {"compose", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_23compose, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_22compose};
static PyObject *__pyx_pw_9pywrapfst_23compose(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compose (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst1,&__pyx_mstate_global->__pyx_n_u_ifst2,&__pyx_mstate_global->__pyx_n_u_compose_filter,&__pyx_mstate_global->__pyx_n_u_connect,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3902, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "compose", 0) < 0) __PYX_ERR(0, 3902, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, i); __PYX_ERR(0, 3902, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3902, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3902, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3902, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));
    }
    __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, 3905, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3905
 *                          Fst ifst2,
 *                          compose_filter="auto",
 *                          bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   compose(ifst1, ifst2, compose_filter="auto", connect=True)
*/
      __pyx_v_connect = ((bool)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("compose", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 3902, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 3902, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 3903, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_22compose(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "pywrapfst.pyx":3902
 * 
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter="auto",
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_22compose(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compose", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.compose_filter = __pyx_v_compose_filter;
  __pyx_t_2.connect = __pyx_v_connect;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_compose(__pyx_v_ifst1, __pyx_v_ifst2, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3902, __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":3942
 * 
 * 
 * cpdef Fst convert(Fst ifst, fst_type=""):             # <<<<<<<<<<<<<<
 *   """
 *   convert(ifst, fst_type="")
*/

static PyObject *__pyx_pw_9pywrapfst_25convert(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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 *)__pyx_mstate_global->__pyx_kp_u__6);
  std::string __pyx_v__fst_type;
  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[3];
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_fst_type = __pyx_optional_args->fst_type;
    }
  }

  /* "pywrapfst.pyx":3959
 *     FstOpError: Conversion failed.
 *   """
 *   cdef string _fst_type = tostring(fst_type)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 3959, __pyx_L1_error)
  __pyx_v__fst_type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":3961
 *   cdef string _fst_type = tostring(fst_type)
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _tfst = fst.Convert(deref(ifst._fst), _fst_type)
 *   # Script-land Convert returns a null pointer to signal failure.
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":3962
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:
 *     _tfst = fst.Convert(deref(ifst._fst), _fst_type)             # <<<<<<<<<<<<<<
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if _tfst.get() == NULL:
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 3962, __pyx_L4_error)
        }
        __pyx_v__tfst = fst::script::Convert((*__pyx_v_ifst->_fst), __pyx_v__fst_type);
      }

      /* "pywrapfst.pyx":3961
 *   cdef string _fst_type = tostring(fst_type)
 *   cdef unique_ptr[fst.FstClass] _tfst
 *   with nogil:             # <<<<<<<<<<<<<<
 *     _tfst = fst.Convert(deref(ifst._fst), _fst_type)
 *   # Script-land Convert returns a null pointer to signal failure.
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":3964
 *     _tfst = fst.Convert(deref(ifst._fst), _fst_type)
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstOpError(f"Conversion to {fst_type!r} failed")
 *   return _init_XFst(_tfst.release())
*/
  __pyx_t_2 = (__pyx_v__tfst.get() == NULL);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":3965
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if _tfst.get() == NULL:
 *     raise FstOpError(f"Conversion to {fst_type!r} failed")             # <<<<<<<<<<<<<<
 *   return _init_XFst(_tfst.release())
 * 
*/
    __pyx_t_4 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_fst_type), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 3965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7[0] = __pyx_mstate_global->__pyx_kp_u_Conversion_to;
    __pyx_t_7[1] = __pyx_t_6;
    __pyx_t_7[2] = __pyx_mstate_global->__pyx_kp_u_failed;
    __pyx_t_8 = __Pyx_PyUnicode_Join(__pyx_t_7, 3, 14 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_6) + 7, 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_6));
    if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3965, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      assert(__pyx_t_4);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_8};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3965, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 3965, __pyx_L1_error)

    /* "pywrapfst.pyx":3964
 *     _tfst = fst.Convert(deref(ifst._fst), _fst_type)
 *   # Script-land Convert returns a null pointer to signal failure.
 *   if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *     raise FstOpError(f"Conversion to {fst_type!r} failed")
 *   return _init_XFst(_tfst.release())
*/
  }

  /* "pywrapfst.pyx":3966
 *   if _tfst.get() == NULL:
 *     raise FstOpError(f"Conversion to {fst_type!r} failed")
 *   return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3966, __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":3942
 * 
 * 
 * cpdef Fst convert(Fst ifst, fst_type=""):             # <<<<<<<<<<<<<<
 *   """
 *   convert(ifst, fst_type="")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __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_25convert(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_24convert, "\n  convert(ifst, fst_type=\"\")\n\n  Constructively converts an FST to a new internal representation.\n\n  Args:\n    ifst: The input FST.\n    fst_type: A string indicating the FST type to convert to, or an empty string\n        if no conversion is desired.\n\n  Returns:\n    The input FST converted to the desired FST type.\n\n  Raises:\n    FstOpError: Conversion failed.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_25convert = {"convert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_25convert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_24convert};
static PyObject *__pyx_pw_9pywrapfst_25convert(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  PyObject *__pyx_v_fst_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("convert (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_fst_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3942, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3942, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3942, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "convert", 0) < 0) __PYX_ERR(0, 3942, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, i); __PYX_ERR(0, 3942, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3942, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3942, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_kp_u__6));
    }
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_Fst *)values[0]);
    __pyx_v_fst_type = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("convert", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 3942, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3942, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_24convert(__pyx_self, __pyx_v_ifst, __pyx_v_fst_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_24convert(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("convert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.fst_type = __pyx_v_fst_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_convert(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3942, __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":3969
 * 
 * 
 * cpdef MutableFst determinize(Fst ifst,             # <<<<<<<<<<<<<<
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
*/

static PyObject *__pyx_pw_9pywrapfst_27determinize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__21;
  PyObject *__pyx_v_det_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_functional);
  int64_t __pyx_v_nstate = __pyx_mstate_global->__pyx_k__22;
  int64_t __pyx_v_subsequential_label = ((int64_t)0);

  /* "pywrapfst.pyx":3974
 *                              int64_t nstate=fst.kNoStateId,
 *                              int64_t subsequential_label=0,
 *                              weight=None,             # <<<<<<<<<<<<<<
 *                              bool increment_subsequential_label=False):
 *   """
*/
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);

  /* "pywrapfst.pyx":3975
 *                              int64_t subsequential_label=0,
 *                              weight=None,
 *                              bool increment_subsequential_label=False):             # <<<<<<<<<<<<<<
 *   """
 *   determinize(ifst, delta=1e-6, det_type="functional",
*/
  bool __pyx_v_increment_subsequential_label = ((bool)0);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  fst::script::WeightClass __pyx_v__weight;
  enum fst::DeterminizeType __pyx_v__det_type;
  std::unique_ptr<fst::script::DeterminizeOptions>  __pyx_v__opts;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::WeightClass __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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("determinize", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_det_type = __pyx_optional_args->det_type;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_nstate = __pyx_optional_args->nstate;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_subsequential_label = __pyx_optional_args->subsequential_label;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_weight = __pyx_optional_args->weight;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_increment_subsequential_label = __pyx_optional_args->increment_subsequential_label;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":4009
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4009, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4009, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4011
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                           weight)
 *   cdef fst.DeterminizeType _det_type
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 4011, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4011, __pyx_L1_error)

  /* "pywrapfst.pyx":4012
 *   # Threshold is set to semiring Zero (no pruning) if weight unspecified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)             # <<<<<<<<<<<<<<
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):
*/
  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_zero(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4011, __pyx_L1_error)
  __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pywrapfst.pyx":4014
 *                                                           weight)
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   cdef unique_ptr[fst.DeterminizeOptions] _opts
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_det_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4014, __pyx_L1_error)
  __pyx_t_3 = (!(fst::script::GetDeterminizeType(__pyx_t_1, (&__pyx_v__det_type)) != 0));
  if (unlikely(__pyx_t_3)) {

    /* "pywrapfst.pyx":4015
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.DeterminizeOptions] _opts
 *   _opts.reset(
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_FstArgError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_det_type), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Unknown_determinization_type, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4015, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 4015, __pyx_L1_error)

    /* "pywrapfst.pyx":4014
 *                                                           weight)
 *   cdef fst.DeterminizeType _det_type
 *   if not fst.GetDeterminizeType(tostring(det_type), addr(_det_type)):             # <<<<<<<<<<<<<<
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   cdef unique_ptr[fst.DeterminizeOptions] _opts
*/
  }

  /* "pywrapfst.pyx":4017
 *     raise FstArgError(f"Unknown determinization type: {det_type!r}")
 *   cdef unique_ptr[fst.DeterminizeOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.DeterminizeOptions(delta,
 *                                  _weight,
*/
  __pyx_v__opts.reset(new fst::script::DeterminizeOptions(__pyx_v_delta, __pyx_v__weight, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v__det_type, __pyx_v_increment_subsequential_label));

  /* "pywrapfst.pyx":4024
 *                                  _det_type,
 *                                  increment_subsequential_label))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Determinize(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4025
 *                                  increment_subsequential_label))
 *   with nogil:
 *     fst.Determinize(deref(ifst._fst), _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4025, __pyx_L5_error)
        }
        fst::script::Determinize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
      }

      /* "pywrapfst.pyx":4024
 *                                  _det_type,
 *                                  increment_subsequential_label))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Determinize(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L6;
        }
        __pyx_L5_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }
  }

  /* "pywrapfst.pyx":4026
 *   with nogil:
 *     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, 4026, __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":3969
 * 
 * 
 * cpdef MutableFst determinize(Fst ifst,             # <<<<<<<<<<<<<<
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __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_27determinize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_26determinize, "\n  determinize(ifst, delta=1e-6, det_type=\"functional\",\n              nstate=NO_STATE_ID, subsequential_label=0, weight=None,\n              incremental_subsequential_label=False)\n\n  Constructively determinizes a weighted FST.\n\n  This operations creates an equivalent FST that has the property that no\n  state has two transitions with the same input label. For this algorithm,\n  epsilon transitions are treated as regular symbols (cf. `rmepsilon`).\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    det_type: Type of determinization; one of: \"functional\" (input transducer is\n        functional), \"nonfunctional\" (input transducer is not functional) and\n        disambiguate\" (input transducer is not functional but only keep the min\n        of ambiguous outputs).\n    nstate: State number threshold.\n    subsequential_label: Input label of arc corresponding to residual final\n        output when producing a subsequential transducer.\n    weight: A Weight or weight string indicating the desired weight threshold\n        below which paths are pruned; if omitted, no paths are pruned.\n    increment_subsequential_label: Increment subsequential when creating\n        several arcs for the residual final output at a given state.\n\n  Returns:\n    An equivalent deterministic FST.\n\n  Raises:\n    FstArgError: Unknown determinization type.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_27determinize = {"determinize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_27determinize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_26determinize};
static PyObject *__pyx_pw_9pywrapfst_27determinize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  PyObject *__pyx_v_det_type = 0;
  int64_t __pyx_v_nstate;
  int64_t __pyx_v_subsequential_label;
  PyObject *__pyx_v_weight = 0;
  bool __pyx_v_increment_subsequential_label;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("determinize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_det_type,&__pyx_mstate_global->__pyx_n_u_nstate,&__pyx_mstate_global->__pyx_n_u_subsequential_label,&__pyx_mstate_global->__pyx_n_u_weight,&__pyx_mstate_global->__pyx_n_u_increment_subsequential_label,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 3969, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "determinize", 0) < 0) __PYX_ERR(0, 3969, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_functional));

      /* "pywrapfst.pyx":3974
 *                              int64_t nstate=fst.kNoStateId,
 *                              int64_t subsequential_label=0,
 *                              weight=None,             # <<<<<<<<<<<<<<
 *                              bool increment_subsequential_label=False):
 *   """
*/
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, i); __PYX_ERR(0, 3969, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 3969, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 3969, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_functional));
      if (!values[5]) values[5] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 3970, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__21;
    }
    __pyx_v_det_type = values[2];
    if (values[3]) {
      __pyx_v_nstate = __Pyx_PyLong_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3972, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_mstate_global->__pyx_k__22;
    }
    if (values[4]) {
      __pyx_v_subsequential_label = __Pyx_PyLong_As_int64_t(values[4]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 3973, __pyx_L3_error)
    } else {
      __pyx_v_subsequential_label = ((int64_t)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, 3975, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":3975
 *                              int64_t 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_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("determinize", 0, 1, 7, __pyx_nargs); __PYX_ERR(0, 3969, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 3969, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_26determinize(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_det_type, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight, __pyx_v_increment_subsequential_label);

  /* "pywrapfst.pyx":3969
 * 
 * 
 * cpdef MutableFst determinize(Fst ifst,             # <<<<<<<<<<<<<<
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_26determinize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, PyObject *__pyx_v_det_type, int64_t __pyx_v_nstate, int64_t __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("determinize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.det_type = __pyx_v_det_type;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.subsequential_label = __pyx_v_subsequential_label;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_2.increment_subsequential_label = __pyx_v_increment_subsequential_label;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_determinize(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3969, __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":4029
 * 
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter="auto",
*/

static PyObject *__pyx_pw_9pywrapfst_29difference(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_n_u_auto);

  /* "pywrapfst.pyx":4032
 *                             Fst ifst2,
 *                             compose_filter="auto",
 *                             bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   difference(ifst1, ifst2, compose_filter="auto", connect=True)
*/
  bool __pyx_v_connect = ((bool)1);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  std::unique_ptr<fst::ComposeOptions>  __pyx_v__opts;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("difference", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_connect = __pyx_optional_args->connect;
      }
    }
  }

  /* "pywrapfst.pyx":4057
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(
*/
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4057, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4057, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4061
 *   _opts.reset(
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.Difference(deref(ifst1._fst.get()),
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4061, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4061, __pyx_L1_error)

  /* "pywrapfst.pyx":4059
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
*/
  __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "pywrapfst.pyx":4062
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Difference(deref(ifst1._fst.get()),
 *                    deref(ifst2._fst.get()),
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4063
 *                             _get_compose_filter(tostring(compose_filter))))
 *   with nogil:
 *     fst.Difference(deref(ifst1._fst.get()),             # <<<<<<<<<<<<<<
 *                    deref(ifst2._fst.get()),
 *                    _tfst.get(),
*/
        if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4063, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4064
 *   with nogil:
 *     fst.Difference(deref(ifst1._fst.get()),
 *                    deref(ifst2._fst.get()),             # <<<<<<<<<<<<<<
 *                    _tfst.get(),
 *                    deref(_opts.get()))
*/
        if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4064, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4063
 *                             _get_compose_filter(tostring(compose_filter))))
 *   with nogil:
 *     fst.Difference(deref(ifst1._fst.get()),             # <<<<<<<<<<<<<<
 *                    deref(ifst2._fst.get()),
 *                    _tfst.get(),
*/
        fst::script::Difference((*__pyx_v_ifst1->_fst.get()), (*__pyx_v_ifst2->_fst.get()), __pyx_v__tfst.get(), (*__pyx_v__opts.get()));
      }

      /* "pywrapfst.pyx":4062
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Difference(deref(ifst1._fst.get()),
 *                    deref(ifst2._fst.get()),
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4067
 *                    _tfst.get(),
 *                    deref(_opts.get()))
 *   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, 4067, __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":4029
 * 
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter="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_29difference(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_28difference, "\n  difference(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n  Constructively computes the difference of two FSTs.\n\n  This operation computes the difference between two FSAs. Only strings that are\n  in the first automaton but not in second are retained in the result. The first\n  argument must be an acceptor; the second argument must be an unweighted,\n  epsilon-free, deterministic acceptor. The output labels of the first\n  transducer or the input labels of the second transducer must be sorted (or\n  otherwise support appropriate matchers).\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    compose_filter: A string matching a known composition filter; one of:\n        \"alt_sequence\", \"auto\", \"match\", \"no_match\", \"null\", \"sequence\",\n        \"trivial\".\n    connect: Should the output FST be trimmed?\n\n  Returns:\n    An FST representing the difference of the FSTs.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_29difference = {"difference", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_29difference, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_28difference};
static PyObject *__pyx_pw_9pywrapfst_29difference(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("difference (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst1,&__pyx_mstate_global->__pyx_n_u_ifst2,&__pyx_mstate_global->__pyx_n_u_compose_filter,&__pyx_mstate_global->__pyx_n_u_connect,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4029, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "difference", 0) < 0) __PYX_ERR(0, 4029, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, i); __PYX_ERR(0, 4029, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4029, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4029, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4029, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));
    }
    __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, 4032, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4032
 *                             Fst ifst2,
 *                             compose_filter="auto",
 *                             bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   difference(ifst1, ifst2, compose_filter="auto", connect=True)
*/
      __pyx_v_connect = ((bool)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("difference", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 4029, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 4029, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 4030, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_28difference(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "pywrapfst.pyx":4029
 * 
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter="auto",
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_28difference(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("difference", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.compose_filter = __pyx_v_compose_filter;
  __pyx_t_2.connect = __pyx_v_connect;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_difference(__pyx_v_ifst1, __pyx_v_ifst2, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4029, __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":4070
 * 
 * 
 * cpdef MutableFst disambiguate(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kDelta,
 *                               int64_t nstate=fst.kNoStateId,
*/

static PyObject *__pyx_pw_9pywrapfst_31disambiguate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__23;
  int64_t __pyx_v_nstate = __pyx_mstate_global->__pyx_k__24;
  int64_t __pyx_v_subsequential_label = ((int64_t)0);

  /* "pywrapfst.pyx":4074
 *                               int64_t nstate=fst.kNoStateId,
 *                               int64_t subsequential_label=0,
 *                               weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,
*/
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  fst::script::WeightClass __pyx_v__weight;
  std::unique_ptr<fst::script::DisambiguateOptions>  __pyx_v__opts;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::WeightClass __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disambiguate", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_nstate = __pyx_optional_args->nstate;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_subsequential_label = __pyx_optional_args->subsequential_label;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_weight = __pyx_optional_args->weight;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":4099
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4099, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4099, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4101
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                      weight)
 *   cdef unique_ptr[fst.DisambiguateOptions] _opts
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 4101, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L1_error)

  /* "pywrapfst.pyx":4102
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                      weight)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.DisambiguateOptions] _opts
 *   _opts.reset(
*/
  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_zero(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4101, __pyx_L1_error)
  __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pywrapfst.pyx":4104
 *                                                      weight)
 *   cdef unique_ptr[fst.DisambiguateOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.DisambiguateOptions(delta,
 *                                   _weight,
*/
  __pyx_v__opts.reset(new fst::script::DisambiguateOptions(__pyx_v_delta, __pyx_v__weight, __pyx_v_nstate, __pyx_v_subsequential_label));

  /* "pywrapfst.pyx":4109
 *                                   nstate,
 *                                   subsequential_label))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Disambiguate(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4110
 *                                   subsequential_label))
 *   with nogil:
 *     fst.Disambiguate(deref(ifst._fst), _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4110, __pyx_L4_error)
        }
        fst::script::Disambiguate((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
      }

      /* "pywrapfst.pyx":4109
 *                                   nstate,
 *                                   subsequential_label))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Disambiguate(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4111
 *   with nogil:
 *     fst.Disambiguate(deref(ifst._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, 4111, __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":4070
 * 
 * 
 * cpdef MutableFst disambiguate(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kDelta,
 *                               int64_t nstate=fst.kNoStateId,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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_31disambiguate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_30disambiguate, "\n  disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,\n               subsequential_label=0, weight=None):\n\n  Constructively disambiguates a weighted transducer.\n\n  This operation disambiguates a weighted transducer. The result will be an\n  equivalent FST that has the property that no two successful paths have the\n  same input labeling. For this algorithm, epsilon transitions are treated as\n  regular symbols (cf. `rmepsilon`).\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    nstate: State number threshold.\n    subsequential_label: Input label of arc corresponding to residual final\n        output when producing a subsequential transducer.\n    weight: A Weight or weight string indicating the desired weight threshold\n        below which paths are pruned; if omitted, no paths are pruned.\n\n  Returns:\n    An equivalent disambiguated FST.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_31disambiguate = {"disambiguate", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_31disambiguate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_30disambiguate};
static PyObject *__pyx_pw_9pywrapfst_31disambiguate(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  int64_t __pyx_v_nstate;
  int64_t __pyx_v_subsequential_label;
  PyObject *__pyx_v_weight = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("disambiguate (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_nstate,&__pyx_mstate_global->__pyx_n_u_subsequential_label,&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4070, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "disambiguate", 0) < 0) __PYX_ERR(0, 4070, __pyx_L3_error)

      /* "pywrapfst.pyx":4074
 *                               int64_t nstate=fst.kNoStateId,
 *                               int64_t subsequential_label=0,
 *                               weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   disambiguate(ifst, delta=0.0009765625, nstate=NO_STATE_ID,
*/
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, i); __PYX_ERR(0, 4070, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4070, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4070, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4071, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__23;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4072, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_mstate_global->__pyx_k__24;
    }
    if (values[3]) {
      __pyx_v_subsequential_label = __Pyx_PyLong_As_int64_t(values[3]); if (unlikely((__pyx_v_subsequential_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4073, __pyx_L3_error)
    } else {
      __pyx_v_subsequential_label = ((int64_t)0);
    }
    __pyx_v_weight = values[4];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("disambiguate", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 4070, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4070, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_30disambiguate(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_subsequential_label, __pyx_v_weight);

  /* "pywrapfst.pyx":4070
 * 
 * 
 * cpdef MutableFst disambiguate(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kDelta,
 *                               int64_t nstate=fst.kNoStateId,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_30disambiguate(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64_t __pyx_v_nstate, int64_t __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("disambiguate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.subsequential_label = __pyx_v_subsequential_label;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_disambiguate(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4070, __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":4114
 * 
 * 
 * cpdef MutableFst epsnormalize(Fst ifst, eps_norm_type="input"):             # <<<<<<<<<<<<<<
 *   """
 *   epsnormalize(ifst, eps_norm_type="input")
*/

static PyObject *__pyx_pw_9pywrapfst_33epsnormalize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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) {
  PyObject *__pyx_v_eps_norm_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_input);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  enum fst::EpsNormalizeType __pyx_v__type;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::EpsNormalizeType __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("epsnormalize", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_eps_norm_type = __pyx_optional_args->eps_norm_type;
    }
  }

  /* "pywrapfst.pyx":4136
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef fst.EpsNormalizeType _type = _get_eps_norm_type(tostring(eps_norm_type))
 *   with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4136, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4136, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4137
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.EpsNormalizeType _type = _get_eps_norm_type(tostring(eps_norm_type))             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.EpsNormalize(deref(ifst._fst), _tfst.get(), _type)
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_eps_norm_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4137, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_eps_norm_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4137, __pyx_L1_error)
  __pyx_v__type = __pyx_t_2;

  /* "pywrapfst.pyx":4138
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.EpsNormalizeType _type = _get_eps_norm_type(tostring(eps_norm_type))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.EpsNormalize(deref(ifst._fst), _tfst.get(), _type)
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4139
 *   cdef fst.EpsNormalizeType _type = _get_eps_norm_type(tostring(eps_norm_type))
 *   with nogil:
 *     fst.EpsNormalize(deref(ifst._fst), _tfst.get(), _type)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4139, __pyx_L4_error)
        }
        fst::script::EpsNormalize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v__type);
      }

      /* "pywrapfst.pyx":4138
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.EpsNormalizeType _type = _get_eps_norm_type(tostring(eps_norm_type))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.EpsNormalize(deref(ifst._fst), _tfst.get(), _type)
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4140
 *   with nogil:
 *     fst.EpsNormalize(deref(ifst._fst), _tfst.get(), _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, 4140, __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":4114
 * 
 * 
 * cpdef MutableFst epsnormalize(Fst ifst, eps_norm_type="input"):             # <<<<<<<<<<<<<<
 *   """
 *   epsnormalize(ifst, eps_norm_type="input")
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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_33epsnormalize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_32epsnormalize, "\n  epsnormalize(ifst, eps_norm_type=\"input\")\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_type: A string matching a known epsilon normalization type; one of:\n          \"input\", \"output\".\n\n  Returns:\n    An equivalent epsilon-normalized FST.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_33epsnormalize = {"epsnormalize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_33epsnormalize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_32epsnormalize};
static PyObject *__pyx_pw_9pywrapfst_33epsnormalize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  PyObject *__pyx_v_eps_norm_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("epsnormalize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_eps_norm_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4114, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4114, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4114, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "epsnormalize", 0) < 0) __PYX_ERR(0, 4114, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_input));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, i); __PYX_ERR(0, 4114, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4114, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4114, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_input));
    }
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_Fst *)values[0]);
    __pyx_v_eps_norm_type = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("epsnormalize", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 4114, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4114, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_32epsnormalize(__pyx_self, __pyx_v_ifst, __pyx_v_eps_norm_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_32epsnormalize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, PyObject *__pyx_v_eps_norm_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst_epsnormalize __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("epsnormalize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.eps_norm_type = __pyx_v_eps_norm_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_epsnormalize(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4114, __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":4143
 * 
 * 
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equal(ifst1, ifst2, delta=0.0009765625)
*/

static PyObject *__pyx_pw_9pywrapfst_35equal(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__25;
  bool __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "pywrapfst.pyx":4161
 *     True if the FSTs satisfy the above condition, else False.
 *   """
 *   with nogil:             # <<<<<<<<<<<<<<
 *     return fst.Equal(deref(ifst1._fst), deref(ifst2._fst), delta)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4162
 *   """
 *   with nogil:
 *     return fst.Equal(deref(ifst1._fst), deref(ifst2._fst), delta)             # <<<<<<<<<<<<<<
 * 
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4162, __pyx_L4_error)
        }
        if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4162, __pyx_L4_error)
        }
        __pyx_r = fst::script::Equal((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":4161
 *     True if the FSTs satisfy the above condition, else False.
 *   """
 *   with nogil:             # <<<<<<<<<<<<<<
 *     return fst.Equal(deref(ifst1._fst), deref(ifst2._fst), delta)
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":4143
 * 
 * 
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equal(ifst1, ifst2, delta=0.0009765625)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_35equal(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_34equal, "\n  equal(ifst1, ifst2, delta=0.0009765625)\n\n  Are two FSTs equal?\n\n  This function tests whether two FSTs have the same states with the same\n  numbering and the same transitions with the same labels and weights in the\n  same order.\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    delta: Comparison/quantization delta.\n\n  Returns:\n    True if the FSTs satisfy the above condition, else False.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_35equal = {"equal", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_35equal, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_34equal};
static PyObject *__pyx_pw_9pywrapfst_35equal(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equal (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst1,&__pyx_mstate_global->__pyx_n_u_ifst2,&__pyx_mstate_global->__pyx_n_u_delta,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4143, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equal", 0) < 0) __PYX_ERR(0, 4143, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, i); __PYX_ERR(0, 4143, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4143, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4143, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4143, __pyx_L3_error)
        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, 4143, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__25;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equal", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 4143, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 4143, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 4143, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_34equal(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_34equal(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equal", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_1 = __pyx_f_9pywrapfst_equal(__pyx_v_ifst1, __pyx_v_ifst2, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 4143, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4143, __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":4165
 * 
 * 
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta) except *:             # <<<<<<<<<<<<<<
 *   """
 *   equivalent(ifst1, ifst2, delta=0.0009765625)
*/

static PyObject *__pyx_pw_9pywrapfst_37equivalent(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__26;
  bool __pyx_v_err;
  bool __pyx_v_is_equiv;
  bool __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equivalent", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "pywrapfst.pyx":4186
 *     FstOpError: Some precondition of the argument FSTs does not hold.
 *   """
 *   cdef bool err = False             # <<<<<<<<<<<<<<
 *   cdef bool is_equiv
 *   with nogil:
*/
  __pyx_v_err = 0;

  /* "pywrapfst.pyx":4188
 *   cdef bool err = False
 *   cdef bool is_equiv
 *   with nogil:             # <<<<<<<<<<<<<<
 *     is_equiv = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst),
 *                               delta, addr(err))
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4189
 *   cdef bool is_equiv
 *   with nogil:
 *     is_equiv = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst),             # <<<<<<<<<<<<<<
 *                               delta, addr(err))
 *   if err:
*/
        if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4189, __pyx_L4_error)
        }
        if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4189, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4190
 *   with nogil:
 *     is_equiv = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst),
 *                               delta, addr(err))             # <<<<<<<<<<<<<<
 *   if err:
 *     raise FstOpError("Argument FST did not satisfy preconditions")
*/
        __pyx_v_is_equiv = fst::script::Equivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta, (&__pyx_v_err));
      }

      /* "pywrapfst.pyx":4188
 *   cdef bool err = False
 *   cdef bool is_equiv
 *   with nogil:             # <<<<<<<<<<<<<<
 *     is_equiv = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst),
 *                               delta, addr(err))
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4191
 *     is_equiv = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst),
 *                               delta, addr(err))
 *   if err:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Argument FST did not satisfy preconditions")
 *   return is_equiv
*/
  __pyx_t_1 = (__pyx_v_err != 0);
  if (unlikely(__pyx_t_1)) {

    /* "pywrapfst.pyx":4192
 *                               delta, addr(err))
 *   if err:
 *     raise FstOpError("Argument FST did not satisfy preconditions")             # <<<<<<<<<<<<<<
 *   return is_equiv
 * 
*/
    __pyx_t_3 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_3);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Argument_FST_did_not_satisfy_pre};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4192, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 4192, __pyx_L1_error)

    /* "pywrapfst.pyx":4191
 *     is_equiv = fst.Equivalent(deref(ifst1._fst), deref(ifst2._fst),
 *                               delta, addr(err))
 *   if err:             # <<<<<<<<<<<<<<
 *     raise FstOpError("Argument FST did not satisfy preconditions")
 *   return is_equiv
*/
  }

  /* "pywrapfst.pyx":4193
 *   if err:
 *     raise FstOpError("Argument FST did not satisfy preconditions")
 *   return is_equiv             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_r = __pyx_v_is_equiv;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4165
 * 
 * 
 * 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_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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_37equivalent(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_36equivalent, "\n  equivalent(ifst1, ifst2, delta=0.0009765625)\n\n  Are the two acceptors equivalent?\n\n  This operation tests whether two epsilon-free deterministic weighted\n  acceptors are equivalent, that is if they accept the same strings with the\n  same weights.\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    delta: Comparison/quantization delta.\n\n  Returns:\n    True if the FSTs satisfy the above condition, else False.\n\n  Raises:\n    FstOpError: Some precondition of the argument FSTs does not hold.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_37equivalent = {"equivalent", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_37equivalent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_36equivalent};
static PyObject *__pyx_pw_9pywrapfst_37equivalent(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("equivalent (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst1,&__pyx_mstate_global->__pyx_n_u_ifst2,&__pyx_mstate_global->__pyx_n_u_delta,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4165, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "equivalent", 0) < 0) __PYX_ERR(0, 4165, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, i); __PYX_ERR(0, 4165, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4165, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4165, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4165, __pyx_L3_error)
        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, 4165, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__26;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("equivalent", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 4165, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 4165, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 4165, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_36equivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_36equivalent(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("equivalent", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_1 = __pyx_f_9pywrapfst_equivalent(__pyx_v_ifst1, __pyx_v_ifst2, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 4165, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4165, __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":4196
 * 
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter="auto",
*/

static PyObject *__pyx_pw_9pywrapfst_39intersect(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_n_u_auto);

  /* "pywrapfst.pyx":4199
 *                            Fst ifst2,
 *                            compose_filter="auto",
 *                            bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   intersect(ifst1, ifst2, compose_filter="auto", connect=True)
*/
  bool __pyx_v_connect = ((bool)1);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  std::unique_ptr<fst::ComposeOptions>  __pyx_v__opts;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ComposeFilter __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("intersect", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_compose_filter = __pyx_optional_args->compose_filter;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_connect = __pyx_optional_args->connect;
      }
    }
  }

  /* "pywrapfst.pyx":4222
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(
*/
  if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4222, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst1->__pyx_vtab)->arc_type(__pyx_v_ifst1, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4222, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4226
 *   _opts.reset(
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.Intersect(deref(ifst1._fst.get()),
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_compose_filter); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4226, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_compose_filter(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4226, __pyx_L1_error)

  /* "pywrapfst.pyx":4224
 *   _tfst.reset(new fst.VectorFstClass(ifst1.arc_type()))
 *   cdef unique_ptr[fst.ComposeOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
*/
  __pyx_v__opts.reset(new fst::ComposeOptions(__pyx_v_connect, __pyx_t_2));

  /* "pywrapfst.pyx":4227
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Intersect(deref(ifst1._fst.get()),
 *                   deref(ifst2._fst.get()),
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4228
 *                             _get_compose_filter(tostring(compose_filter))))
 *   with nogil:
 *     fst.Intersect(deref(ifst1._fst.get()),             # <<<<<<<<<<<<<<
 *                   deref(ifst2._fst.get()),
 *                   _tfst.get(),
*/
        if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4228, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4229
 *   with nogil:
 *     fst.Intersect(deref(ifst1._fst.get()),
 *                   deref(ifst2._fst.get()),             # <<<<<<<<<<<<<<
 *                   _tfst.get(),
 *                   deref(_opts.get()))
*/
        if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4229, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4228
 *                             _get_compose_filter(tostring(compose_filter))))
 *   with nogil:
 *     fst.Intersect(deref(ifst1._fst.get()),             # <<<<<<<<<<<<<<
 *                   deref(ifst2._fst.get()),
 *                   _tfst.get(),
*/
        fst::script::Intersect((*__pyx_v_ifst1->_fst.get()), (*__pyx_v_ifst2->_fst.get()), __pyx_v__tfst.get(), (*__pyx_v__opts.get()));
      }

      /* "pywrapfst.pyx":4227
 *       new fst.ComposeOptions(connect,
 *                             _get_compose_filter(tostring(compose_filter))))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Intersect(deref(ifst1._fst.get()),
 *                   deref(ifst2._fst.get()),
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4232
 *                   _tfst.get(),
 *                   deref(_opts.get()))
 *   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, 4232, __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":4196
 * 
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter="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_39intersect(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_38intersect, "\n  intersect(ifst1, ifst2, compose_filter=\"auto\", connect=True)\n\n  Constructively intersects two FSTs.\n\n  This operation computes the intersection (Hadamard product) of two FSTs.\n  Only strings that are in both automata are retained in the result. The two\n  arguments must be acceptors. One of the arguments must be label-sorted (or\n  otherwise support appropriate matchers).\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    compose_filter: A string matching a known composition filter; one of:\n        \"alt_sequence\", \"auto\", \"match\", \"no_match\", \"null\", \"sequence\",\n        \"trivial\".\n    connect: Should output be trimmed?\n\n  Returns:\n    An intersected FST.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_39intersect = {"intersect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_39intersect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_38intersect};
static PyObject *__pyx_pw_9pywrapfst_39intersect(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("intersect (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst1,&__pyx_mstate_global->__pyx_n_u_ifst2,&__pyx_mstate_global->__pyx_n_u_compose_filter,&__pyx_mstate_global->__pyx_n_u_connect,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4196, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "intersect", 0) < 0) __PYX_ERR(0, 4196, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, i); __PYX_ERR(0, 4196, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4196, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4196, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4196, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));
    }
    __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, 4199, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4199
 *                            Fst ifst2,
 *                            compose_filter="auto",
 *                            bool connect=True):             # <<<<<<<<<<<<<<
 *   """
 *   intersect(ifst1, ifst2, compose_filter="auto", connect=True)
*/
      __pyx_v_connect = ((bool)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("intersect", 0, 2, 4, __pyx_nargs); __PYX_ERR(0, 4196, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 4196, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 4197, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_38intersect(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_compose_filter, __pyx_v_connect);

  /* "pywrapfst.pyx":4196
 * 
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter="auto",
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_38intersect(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("intersect", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.compose_filter = __pyx_v_compose_filter;
  __pyx_t_2.connect = __pyx_v_connect;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_intersect(__pyx_v_ifst1, __pyx_v_ifst2, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4196, __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":4235
 * 
 * 
 * cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   isomorphic(ifst1, ifst2, delta=0.0009765625)
*/

static PyObject *__pyx_pw_9pywrapfst_41isomorphic(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__27;
  bool __pyx_r;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
    }
  }

  /* "pywrapfst.pyx":4256
 *     True if the two transducers satisfy the above condition, else False.
 *   """
 *   with nogil:             # <<<<<<<<<<<<<<
 *     return fst.Isomorphic(deref(ifst1._fst), deref(ifst2._fst), delta)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4257
 *   """
 *   with nogil:
 *     return fst.Isomorphic(deref(ifst1._fst), deref(ifst2._fst), delta)             # <<<<<<<<<<<<<<
 * 
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4257, __pyx_L4_error)
        }
        if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4257, __pyx_L4_error)
        }
        __pyx_r = fst::script::Isomorphic((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_delta);
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":4256
 *     True if the two transducers satisfy the above condition, else False.
 *   """
 *   with nogil:             # <<<<<<<<<<<<<<
 *     return fst.Isomorphic(deref(ifst1._fst), deref(ifst2._fst), delta)
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":4235
 * 
 * 
 * cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   isomorphic(ifst1, ifst2, delta=0.0009765625)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_41isomorphic(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_40isomorphic, "\n  isomorphic(ifst1, ifst2, delta=0.0009765625)\n\n  Are the two acceptors isomorphic?\n\n  This operation determines if two transducers with a certain required\n  determinism have the same states, irrespective of numbering, and the same\n  transitions with the same labels and weights, irrespective of ordering. In\n  other words, FSTs A, B are isomorphic if and only if the states of A can be\n  renumbered and the transitions leaving each state reordered so the two are\n  equal (according to the definition given in `equal`).\n\n  Args:\n    ifst1: The first input FST.\n    ifst2: The second input FST.\n    delta: Comparison/quantization delta.\n\n  Returns:\n    True if the two transducers satisfy the above condition, else False.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_41isomorphic = {"isomorphic", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_41isomorphic, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_40isomorphic};
static PyObject *__pyx_pw_9pywrapfst_41isomorphic(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  float __pyx_v_delta;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("isomorphic (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst1,&__pyx_mstate_global->__pyx_n_u_ifst2,&__pyx_mstate_global->__pyx_n_u_delta,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4235, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "isomorphic", 0) < 0) __PYX_ERR(0, 4235, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, i); __PYX_ERR(0, 4235, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4235, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4235, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4235, __pyx_L3_error)
        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, 4235, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__27;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("isomorphic", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 4235, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 4235, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 4235, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_40isomorphic(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_delta);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_40isomorphic(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("isomorphic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_1 = __pyx_f_9pywrapfst_isomorphic(__pyx_v_ifst1, __pyx_v_ifst2, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 4235, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4235, __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":4260
 * 
 * 
 * cpdef MutableFst prune(Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        int64_t nstate=fst.kNoStateId,
*/

static PyObject *__pyx_pw_9pywrapfst_43prune(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__28;
  int64_t __pyx_v_nstate = __pyx_mstate_global->__pyx_k__29;

  /* "pywrapfst.pyx":4263
 *                        float delta=fst.kDelta,
 *                        int64_t nstate=fst.kNoStateId,
 *                        weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
*/
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  fst::script::WeightClass __pyx_v__weight;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::WeightClass __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prune", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_nstate = __pyx_optional_args->nstate;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_weight = __pyx_optional_args->weight;
        }
      }
    }
  }

  /* "pywrapfst.pyx":4285
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4285, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4285, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4286
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                           weight)
 *   with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 4286, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4286, __pyx_L1_error)

  /* "pywrapfst.pyx":4287
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
*/
  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_zero(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4286, __pyx_L1_error)
  __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pywrapfst.pyx":4288
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4289
 *                                                           weight)
 *   with nogil:
 *     fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4289, __pyx_L4_error)
        }
        fst::script::Prune((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v__weight, __pyx_v_nstate, __pyx_v_delta);
      }

      /* "pywrapfst.pyx":4288
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4290
 *   with nogil:
 *     fst.Prune(deref(ifst._fst), _tfst.get(), _weight, nstate, delta)
 *   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, 4290, __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":4260
 * 
 * 
 * cpdef MutableFst prune(Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        int64_t nstate=fst.kNoStateId,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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_43prune(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_42prune, "\n  prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)\n\n  Constructively removes paths with weights below a certain threshold.\n\n  This operation deletes states and arcs in the input FST that do not belong\n  to a successful path whose weight is no more (w.r.t the natural semiring\n  order) than the threshold t \\otimes-times the weight of the shortest path in\n  the input FST. Weights must be commutative and have the path property.\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    nstate: State number threshold.\n    weight: A Weight or weight string indicating the desired weight threshold\n        below which paths are pruned; if omitted, no paths are pruned.\n\n  Returns:\n    A pruned FST.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_43prune = {"prune", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_43prune, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_42prune};
static PyObject *__pyx_pw_9pywrapfst_43prune(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  int64_t __pyx_v_nstate;
  PyObject *__pyx_v_weight = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[4] = {0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prune (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_nstate,&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4260, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "prune", 0) < 0) __PYX_ERR(0, 4260, __pyx_L3_error)

      /* "pywrapfst.pyx":4263
 *                        float delta=fst.kDelta,
 *                        int64_t nstate=fst.kNoStateId,
 *                        weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   prune(ifst, delta=0.0009765625, nstate=NO_STATE_ID, weight=None)
*/
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, i); __PYX_ERR(0, 4260, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4260, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4260, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4261, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__28;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4262, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_mstate_global->__pyx_k__29;
    }
    __pyx_v_weight = values[3];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prune", 0, 1, 4, __pyx_nargs); __PYX_ERR(0, 4260, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4260, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_42prune(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_weight);

  /* "pywrapfst.pyx":4260
 * 
 * 
 * cpdef MutableFst prune(Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        int64_t nstate=fst.kNoStateId,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_42prune(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64_t __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prune", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_prune(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4260, __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":4293
 * 
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
*/

static PyObject *__pyx_pw_9pywrapfst_45push(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__30;

  /* "pywrapfst.pyx":4295
 * 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":4296
 *                       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":4297
 *                       bool push_weights=False,
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,             # <<<<<<<<<<<<<<
 *                       bool remove_total_weight=False,
 *                       reweight_type="to_initial"):
*/
  bool __pyx_v_remove_common_affix = ((bool)0);

  /* "pywrapfst.pyx":4298
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                       reweight_type="to_initial"):
 *   """
*/
  bool __pyx_v_remove_total_weight = ((bool)0);
  PyObject *__pyx_v_reweight_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  uint8_t __pyx_v_flags;
  enum fst::ReweightType __pyx_v__type;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  enum fst::ReweightType __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("push", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_push_weights = __pyx_optional_args->push_weights;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_push_labels = __pyx_optional_args->push_labels;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_remove_common_affix = __pyx_optional_args->remove_common_affix;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_remove_total_weight = __pyx_optional_args->remove_total_weight;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_reweight_type = __pyx_optional_args->reweight_type;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":4338
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef uint8_t flags = fst.GetPushFlags(push_weights,
 *                                       push_labels,
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4338, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4338, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4339
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef uint8_t flags = fst.GetPushFlags(push_weights,             # <<<<<<<<<<<<<<
 *                                       push_labels,
 *                                       remove_total_weight,
*/
  __pyx_v_flags = fst::script::GetPushFlags(__pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_total_weight, __pyx_v_remove_common_affix);

  /* "pywrapfst.pyx":4343
 *                                       remove_total_weight,
 *                                       remove_common_affix)
 *   cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.Push(deref(ifst._fst), _tfst.get(), flags, _type, delta)
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_reweight_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_reweight_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4343, __pyx_L1_error)
  __pyx_v__type = __pyx_t_2;

  /* "pywrapfst.pyx":4344
 *                                       remove_common_affix)
 *   cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Push(deref(ifst._fst), _tfst.get(), flags, _type, delta)
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4345
 *   cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *   with nogil:
 *     fst.Push(deref(ifst._fst), _tfst.get(), flags, _type, delta)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4345, __pyx_L4_error)
        }
        fst::script::Push((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v_flags, __pyx_v__type, __pyx_v_delta);
      }

      /* "pywrapfst.pyx":4344
 *                                       remove_common_affix)
 *   cdef fst.ReweightType _type = _get_reweight_type(tostring(reweight_type))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Push(deref(ifst._fst), _tfst.get(), flags, _type, delta)
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4346
 *   with nogil:
 *     fst.Push(deref(ifst._fst), _tfst.get(), flags, _type, delta)
 *   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, 4346, __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":4293
 * 
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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_45push(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_44push, "\n  push(ifst, delta=0.0009765625, push_weights=False, push_labels=False,\n       remove_common_affix=False, remove_total_weight=False,\n       reweight_type=\"to_initial\")\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    reweight_type: Push towards initial or final states?: a string matching a\n        known reweight type: one of \"to_initial\", \"to_final\"\n\n  Returns:\n    An equivalent pushed FST.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_45push = {"push", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_45push, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_44push};
static PyObject *__pyx_pw_9pywrapfst_45push(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  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;
  PyObject *__pyx_v_reweight_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("push (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_push_weights,&__pyx_mstate_global->__pyx_n_u_push_labels,&__pyx_mstate_global->__pyx_n_u_remove_common_affix,&__pyx_mstate_global->__pyx_n_u_remove_total_weight,&__pyx_mstate_global->__pyx_n_u_reweight_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4293, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "push", 0) < 0) __PYX_ERR(0, 4293, __pyx_L3_error)
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, i); __PYX_ERR(0, 4293, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4293, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4293, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_to_initial));
    }
    __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, 4294, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__30;
    }
    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, 4295, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4295
 * 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, 4296, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4296
 *                       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, 4297, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4297
 *                       bool push_weights=False,
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,             # <<<<<<<<<<<<<<
 *                       bool remove_total_weight=False,
 *                       reweight_type="to_initial"):
*/
      __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, 4298, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4298
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                       reweight_type="to_initial"):
 *   """
*/
      __pyx_v_remove_total_weight = ((bool)0);
    }
    __pyx_v_reweight_type = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("push", 0, 1, 7, __pyx_nargs); __PYX_ERR(0, 4293, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4293, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_44push(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_push_weights, __pyx_v_push_labels, __pyx_v_remove_common_affix, __pyx_v_remove_total_weight, __pyx_v_reweight_type);

  /* "pywrapfst.pyx":4293
 * 
 * 
 * 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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_44push(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, PyObject *__pyx_v_reweight_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst_push __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("push", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.push_weights = __pyx_v_push_weights;
  __pyx_t_2.push_labels = __pyx_v_push_labels;
  __pyx_t_2.remove_common_affix = __pyx_v_remove_common_affix;
  __pyx_t_2.remove_total_weight = __pyx_v_remove_total_weight;
  __pyx_t_2.reweight_type = __pyx_v_reweight_type;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_push(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4293, __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":4349
 * 
 * 
 * cpdef bool randequivalent(Fst ifst1,             # <<<<<<<<<<<<<<
 *                           Fst ifst2,
 *                           int32_t npath=1,
*/

static PyObject *__pyx_pw_9pywrapfst_47randequivalent(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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) {
  int32_t __pyx_v_npath = ((int32_t)1);
  float __pyx_v_delta = __pyx_mstate_global->__pyx_k__31;
  PyObject *__pyx_v_select = ((PyObject *)__pyx_mstate_global->__pyx_n_u_uniform);
  int32_t __pyx_v_max_length = __pyx_mstate_global->__pyx_k__32;
  uint64_t __pyx_v_seed = __pyx_mstate_global->__pyx_k__33;
  fst::script::RandArcSelection __pyx_v__select;
  std::unique_ptr<fst::RandGenOptions<fst::script::RandArcSelection> >  __pyx_v__opts;
  uint64_t __pyx_v__seed;
  bool __pyx_r;
  std::string __pyx_t_1;
  fst::script::RandArcSelection __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_npath = __pyx_optional_args->npath;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_delta = __pyx_optional_args->delta;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_select = __pyx_optional_args->select;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_max_length = __pyx_optional_args->max_length;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_seed = __pyx_optional_args->seed;
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":4382
 *     True if the two transducers satisfy the above condition, else False.
 *   """
 *   cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
 *   # The three trailing options will be ignored by RandEquivalent.
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4382, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4382, __pyx_L1_error)
  __pyx_v__select = __pyx_t_2;

  /* "pywrapfst.pyx":4385
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
 *   # The three trailing options will be ignored by RandEquivalent.
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *        new fst.RandGenOptions[fst.RandArcSelection](_select,
 *                                                     max_length,
*/
  __pyx_v__opts.reset(new fst::RandGenOptions<fst::script::RandArcSelection> (__pyx_v__select, __pyx_v_max_length, 1, 0, 0));

  /* "pywrapfst.pyx":4391
 *                                                     False,
 *                                                     False))
 *   cdef uint64_t _seed = fst.GetSeed(seed)             # <<<<<<<<<<<<<<
 *   with nogil:
 *     return fst.RandEquivalent(deref(ifst1._fst),
*/
  __pyx_v__seed = fst::script::GetSeed(__pyx_v_seed);

  /* "pywrapfst.pyx":4392
 *                                                     False))
 *   cdef uint64_t _seed = fst.GetSeed(seed)
 *   with nogil:             # <<<<<<<<<<<<<<
 *     return fst.RandEquivalent(deref(ifst1._fst),
 *                               deref(ifst2._fst),
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4393
 *   cdef uint64_t _seed = fst.GetSeed(seed)
 *   with nogil:
 *     return fst.RandEquivalent(deref(ifst1._fst),             # <<<<<<<<<<<<<<
 *                               deref(ifst2._fst),
 *                               npath,
*/
        if (unlikely(((PyObject *)__pyx_v_ifst1) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4393, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4394
 *   with nogil:
 *     return fst.RandEquivalent(deref(ifst1._fst),
 *                               deref(ifst2._fst),             # <<<<<<<<<<<<<<
 *                               npath,
 *                               deref(_opts),
*/
        if (unlikely(((PyObject *)__pyx_v_ifst2) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4394, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4393
 *   cdef uint64_t _seed = fst.GetSeed(seed)
 *   with nogil:
 *     return fst.RandEquivalent(deref(ifst1._fst),             # <<<<<<<<<<<<<<
 *                               deref(ifst2._fst),
 *                               npath,
*/
        __pyx_r = fst::script::RandEquivalent((*__pyx_v_ifst1->_fst), (*__pyx_v_ifst2->_fst), __pyx_v_npath, (*__pyx_v__opts), __pyx_v_delta, __pyx_v__seed);
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":4392
 *                                                     False))
 *   cdef uint64_t _seed = fst.GetSeed(seed)
 *   with nogil:             # <<<<<<<<<<<<<<
 *     return fst.RandEquivalent(deref(ifst1._fst),
 *                               deref(ifst2._fst),
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":4349
 * 
 * 
 * cpdef bool randequivalent(Fst ifst1,             # <<<<<<<<<<<<<<
 *                           Fst ifst2,
 *                           int32_t npath=1,
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_47randequivalent(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_46randequivalent, "\n  randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, select=\"uniform\",\n                 max_length=2147483647, seed=-1)\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 not specified,\n        the current time is used.\n    select: A string matching a known random arc selection type; one of:\n        \"uniform\", \"log_prob\", \"fast_log_prob\".\n    max_length: The maximum length of each random path.\n\n  Returns:\n    True if the two transducers satisfy the above condition, else False.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_47randequivalent = {"randequivalent", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_47randequivalent, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_46randequivalent};
static PyObject *__pyx_pw_9pywrapfst_47randequivalent(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1 = 0;
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2 = 0;
  int32_t __pyx_v_npath;
  float __pyx_v_delta;
  PyObject *__pyx_v_select = 0;
  int32_t __pyx_v_max_length;
  uint64_t __pyx_v_seed;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("randequivalent (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst1,&__pyx_mstate_global->__pyx_n_u_ifst2,&__pyx_mstate_global->__pyx_n_u_npath,&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_select,&__pyx_mstate_global->__pyx_n_u_max_length,&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4349, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "randequivalent", 0) < 0) __PYX_ERR(0, 4349, __pyx_L3_error)
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uniform));
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, i); __PYX_ERR(0, 4349, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4349, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4349, __pyx_L3_error)
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4349, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uniform));
    }
    __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_PyLong_As_int32_t(values[2]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4351, __pyx_L3_error)
    } else {
      __pyx_v_npath = ((int32_t)1);
    }
    if (values[3]) {
      __pyx_v_delta = __Pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_delta == (float)-1) && PyErr_Occurred())) __PYX_ERR(0, 4352, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__31;
    }
    __pyx_v_select = values[4];
    if (values[5]) {
      __pyx_v_max_length = __Pyx_PyLong_As_int32_t(values[5]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4354, __pyx_L3_error)
    } else {
      __pyx_v_max_length = __pyx_mstate_global->__pyx_k__32;
    }
    if (values[6]) {
      __pyx_v_seed = __Pyx_PyLong_As_uint64_t(values[6]); if (unlikely((__pyx_v_seed == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4355, __pyx_L3_error)
    } else {
      __pyx_v_seed = __pyx_mstate_global->__pyx_k__33;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("randequivalent", 0, 2, 7, __pyx_nargs); __PYX_ERR(0, 4349, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst1", 0))) __PYX_ERR(0, 4349, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst2), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst2", 0))) __PYX_ERR(0, 4350, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_46randequivalent(__pyx_self, __pyx_v_ifst1, __pyx_v_ifst2, __pyx_v_npath, __pyx_v_delta, __pyx_v_select, __pyx_v_max_length, __pyx_v_seed);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_46randequivalent(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst1, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst2, int32_t __pyx_v_npath, float __pyx_v_delta, PyObject *__pyx_v_select, int32_t __pyx_v_max_length, uint64_t __pyx_v_seed) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  bool __pyx_t_1;
  struct __pyx_opt_args_9pywrapfst_randequivalent __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("randequivalent", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 5;
  __pyx_t_2.npath = __pyx_v_npath;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.select = __pyx_v_select;
  __pyx_t_2.max_length = __pyx_v_max_length;
  __pyx_t_2.seed = __pyx_v_seed;
  __pyx_t_1 = __pyx_f_9pywrapfst_randequivalent(__pyx_v_ifst1, __pyx_v_ifst2, 1, &__pyx_t_2); if (unlikely(__pyx_t_1 == ((bool)-1) && PyErr_Occurred())) __PYX_ERR(0, 4349, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4349, __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":4401
 * 
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32_t npath=1,
 *                          select="uniform",
*/

static PyObject *__pyx_pw_9pywrapfst_49randgen(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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) {
  int32_t __pyx_v_npath = ((int32_t)1);
  PyObject *__pyx_v_select = ((PyObject *)__pyx_mstate_global->__pyx_n_u_uniform);
  int32_t __pyx_v_max_length = __pyx_mstate_global->__pyx_k__34;

  /* "pywrapfst.pyx":4405
 *                          select="uniform",
 *                          int32_t max_length=numeric_limits[int32_t].max(),
 *                          bool weighted=False,             # <<<<<<<<<<<<<<
 *                          bool remove_total_weight=False,
 *                          uint64_t seed=fst.kDefaultSeed):
*/
  bool __pyx_v_weighted = ((bool)0);

  /* "pywrapfst.pyx":4406
 *                          int32_t max_length=numeric_limits[int32_t].max(),
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                          uint64_t seed=fst.kDefaultSeed):
 *   """
*/
  bool __pyx_v_remove_total_weight = ((bool)0);
  uint64_t __pyx_v_seed = __pyx_mstate_global->__pyx_k__35;
  fst::script::RandArcSelection __pyx_v__select;
  std::unique_ptr<fst::RandGenOptions<fst::script::RandArcSelection> >  __pyx_v__opts;
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  uint64_t __pyx_v__seed;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::RandArcSelection __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("randgen", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_npath = __pyx_optional_args->npath;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_select = __pyx_optional_args->select;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_max_length = __pyx_optional_args->max_length;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_weighted = __pyx_optional_args->weighted;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_remove_total_weight = __pyx_optional_args->remove_total_weight;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_seed = __pyx_optional_args->seed;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":4437
 *     An FST containing one or more random paths.
 *   """
 *   cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
 *   _opts.reset(
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_select); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4437, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_rand_arc_selection(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4437, __pyx_L1_error)
  __pyx_v__select = __pyx_t_2;

  /* "pywrapfst.pyx":4439
 *   cdef fst.RandArcSelection _select = _get_rand_arc_selection(tostring(select))
 *   cdef unique_ptr[fst.RandGenOptions[fst.RandArcSelection]] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.RandGenOptions[fst.RandArcSelection](_select,
 *                                                    max_length,
*/
  __pyx_v__opts.reset(new fst::RandGenOptions<fst::script::RandArcSelection> (__pyx_v__select, __pyx_v_max_length, __pyx_v_npath, __pyx_v_weighted, __pyx_v_remove_total_weight));

  /* "pywrapfst.pyx":4446
 *                                                    remove_total_weight))
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   cdef uint64_t _seed = fst.GetSeed(seed)
 *   with nogil:
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4446, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4446, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4447
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef uint64_t _seed = fst.GetSeed(seed)             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), _seed)
*/
  __pyx_v__seed = fst::script::GetSeed(__pyx_v_seed);

  /* "pywrapfst.pyx":4448
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef uint64_t _seed = fst.GetSeed(seed)
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), _seed)
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4449
 *   cdef uint64_t _seed = fst.GetSeed(seed)
 *   with nogil:
 *     fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), _seed)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4449, __pyx_L4_error)
        }
        fst::script::RandGen((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts), __pyx_v__seed);
      }

      /* "pywrapfst.pyx":4448
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   cdef uint64_t _seed = fst.GetSeed(seed)
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), _seed)
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4450
 *   with nogil:
 *     fst.RandGen(deref(ifst._fst), _tfst.get(), deref(_opts), _seed)
 *   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, 4450, __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":4401
 * 
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32_t npath=1,
 *                          select="uniform",
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __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_49randgen(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_48randgen, "\n  randgen(ifst, npath=1, seed=0, select=\"uniform\", max_length=2147483647,\n          weighted=False, remove_total_weight=False, seed=-1)\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 not specified,\n        the current time is used.\n    select: A string matching a known random arc selection type; one of:\n        \"uniform\", \"log_prob\", \"fast_log_prob\".\n    max_length: The maximum length of each random path.\n    weighted: Should the output be weighted by path count?\n    remove_total_weight: Should the total weight be removed (ignored when\n        `weighted` is False)?\n\n  Returns:\n    An FST containing one or more random paths.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_49randgen = {"randgen", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_49randgen, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_48randgen};
static PyObject *__pyx_pw_9pywrapfst_49randgen(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  int32_t __pyx_v_npath;
  PyObject *__pyx_v_select = 0;
  int32_t __pyx_v_max_length;
  bool __pyx_v_weighted;
  bool __pyx_v_remove_total_weight;
  uint64_t __pyx_v_seed;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("randgen (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_npath,&__pyx_mstate_global->__pyx_n_u_select,&__pyx_mstate_global->__pyx_n_u_max_length,&__pyx_mstate_global->__pyx_n_u_weighted,&__pyx_mstate_global->__pyx_n_u_remove_total_weight,&__pyx_mstate_global->__pyx_n_u_seed,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4401, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "randgen", 0) < 0) __PYX_ERR(0, 4401, __pyx_L3_error)
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uniform));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, i); __PYX_ERR(0, 4401, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4401, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4401, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_uniform));
    }
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_Fst *)values[0]);
    if (values[1]) {
      __pyx_v_npath = __Pyx_PyLong_As_int32_t(values[1]); if (unlikely((__pyx_v_npath == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4402, __pyx_L3_error)
    } else {
      __pyx_v_npath = ((int32_t)1);
    }
    __pyx_v_select = values[2];
    if (values[3]) {
      __pyx_v_max_length = __Pyx_PyLong_As_int32_t(values[3]); if (unlikely((__pyx_v_max_length == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4404, __pyx_L3_error)
    } else {
      __pyx_v_max_length = __pyx_mstate_global->__pyx_k__34;
    }
    if (values[4]) {
      __pyx_v_weighted = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_weighted == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4405, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4405
 *                          select="uniform",
 *                          int32_t max_length=numeric_limits[int32_t].max(),
 *                          bool weighted=False,             # <<<<<<<<<<<<<<
 *                          bool remove_total_weight=False,
 *                          uint64_t seed=fst.kDefaultSeed):
*/
      __pyx_v_weighted = ((bool)0);
    }
    if (values[5]) {
      __pyx_v_remove_total_weight = __Pyx_PyObject_IsTrue(values[5]); if (unlikely((__pyx_v_remove_total_weight == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4406, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4406
 *                          int32_t max_length=numeric_limits[int32_t].max(),
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                          uint64_t seed=fst.kDefaultSeed):
 *   """
*/
      __pyx_v_remove_total_weight = ((bool)0);
    }
    if (values[6]) {
      __pyx_v_seed = __Pyx_PyLong_As_uint64_t(values[6]); if (unlikely((__pyx_v_seed == ((uint64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4407, __pyx_L3_error)
    } else {
      __pyx_v_seed = __pyx_mstate_global->__pyx_k__35;
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("randgen", 0, 1, 7, __pyx_nargs); __PYX_ERR(0, 4401, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4401, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_48randgen(__pyx_self, __pyx_v_ifst, __pyx_v_npath, __pyx_v_select, __pyx_v_max_length, __pyx_v_weighted, __pyx_v_remove_total_weight, __pyx_v_seed);

  /* "pywrapfst.pyx":4401
 * 
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32_t npath=1,
 *                          select="uniform",
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_48randgen(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, int32_t __pyx_v_npath, PyObject *__pyx_v_select, int32_t __pyx_v_max_length, bool __pyx_v_weighted, bool __pyx_v_remove_total_weight, uint64_t __pyx_v_seed) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst_randgen __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("randgen", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.npath = __pyx_v_npath;
  __pyx_t_2.select = __pyx_v_select;
  __pyx_t_2.max_length = __pyx_v_max_length;
  __pyx_t_2.remove_total_weight = __pyx_v_weighted;
  __pyx_t_2.weighted = __pyx_v_remove_total_weight;
  __pyx_t_2.seed = __pyx_v_seed;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_randgen(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4401, __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":4453
 * 
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
*/

static PyObject *__pyx_pw_9pywrapfst_51replace(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_n_u_input);
  PyObject *__pyx_v_return_arc_labeling = ((PyObject *)__pyx_mstate_global->__pyx_n_u_neither);

  /* "pywrapfst.pyx":4456
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
 *                          bool epsilon_on_replace=False,             # <<<<<<<<<<<<<<
 *                          int64_t return_label=0):
 *   """
*/
  bool __pyx_v_epsilon_on_replace = ((bool)0);
  int64_t __pyx_v_return_label = ((int64_t)0);
  int64_t __pyx_v__label;
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v__pfst = 0;
  std::vector<__pyx_t_10cpywrapfst_LabelFstClassPair>  __pyx_v__pairs;
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  enum fst::ReplaceLabelType __pyx_v__cal;
  enum fst::ReplaceLabelType __pyx_v__ral;
  std::unique_ptr<fst::script::ReplaceOptions>  __pyx_v__opts;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int64_t __pyx_t_9;
  __pyx_t_10cpywrapfst_LabelFstClassPair __pyx_t_10;
  std::string __pyx_t_11;
  enum fst::ReplaceLabelType __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("replace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_call_arc_labeling = __pyx_optional_args->call_arc_labeling;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_return_arc_labeling = __pyx_optional_args->return_arc_labeling;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_epsilon_on_replace = __pyx_optional_args->epsilon_on_replace;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_return_label = __pyx_optional_args->return_label;
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":4497
 *   cdef Fst _pfst
 *   cdef vector[fst.LabelFstClassPair] _pairs
 *   for (_label, _pfst) in pairs:             # <<<<<<<<<<<<<<
 *       _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
*/
  if (likely(PyList_CheckExact(__pyx_v_pairs)) || PyTuple_CheckExact(__pyx_v_pairs)) {
    __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1);
    __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4497, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 4497, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        __pyx_t_4 = __Pyx_PyList_GetItemRef(__pyx_t_1, __pyx_t_2);
        ++__pyx_t_2;
      } else {
        {
          Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_1);
          #if !CYTHON_ASSUME_SAFE_SIZE
          if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 4497, __pyx_L1_error)
          #endif
          if (__pyx_t_2 >= __pyx_temp) break;
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2));
        #else
        __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_1, __pyx_t_2);
        #endif
        ++__pyx_t_2;
      }
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4497, __pyx_L1_error)
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 4497, __pyx_L1_error)
          PyErr_Clear();
        }
        break;
      }
    }
    __Pyx_GOTREF(__pyx_t_4);
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 4497, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __Pyx_INCREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
        __Pyx_INCREF(__pyx_t_6);
      } else {
        __pyx_t_5 = __Pyx_PyList_GetItemRef(sequence, 0);
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4497, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_5);
        __pyx_t_6 = __Pyx_PyList_GetItemRef(sequence, 1);
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4497, __pyx_L1_error)
        __Pyx_XGOTREF(__pyx_t_6);
      }
      #else
      __pyx_t_5 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_7);
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 4497, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 4497, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __pyx_t_9 = __Pyx_PyLong_As_int64_t(__pyx_t_5); if (unlikely((__pyx_t_9 == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4497, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4497, __pyx_L1_error)
    __pyx_v__label = __pyx_t_9;
    __Pyx_XDECREF_SET(__pyx_v__pfst, ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "pywrapfst.pyx":4498
 *   cdef vector[fst.LabelFstClassPair] _pairs
 *   for (_label, _pfst) in pairs:
 *       _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
*/
    if (unlikely(((PyObject *)__pyx_v__pfst) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
      __PYX_ERR(0, 4498, __pyx_L1_error)
    }
    try {
      __pyx_t_10 = __pyx_t_10cpywrapfst_LabelFstClassPair(__pyx_v__label, __pyx_v__pfst->_fst.get());
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 4498, __pyx_L1_error)
    }
    try {
      __pyx_v__pairs.push_back(__pyx_t_10);
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 4498, __pyx_L1_error)
    }

    /* "pywrapfst.pyx":4497
 *   cdef Fst _pfst
 *   cdef vector[fst.LabelFstClassPair] _pairs
 *   for (_label, _pfst) in pairs:             # <<<<<<<<<<<<<<
 *       _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
*/
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "pywrapfst.pyx":4500
 *       _pairs.push_back(fst.LabelFstClassPair(_label, _pfst._fst.get()))
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))             # <<<<<<<<<<<<<<
 *   cdef fst.ReplaceLabelType _cal = _get_replace_label_type(
 *       tostring(call_arc_labeling),
*/
  __pyx_v__tfst.reset(new fst::script::VectorFstClass((__pyx_v__pairs[0]).second->ArcType()));

  /* "pywrapfst.pyx":4502
 *   _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
 *   cdef fst.ReplaceLabelType _cal = _get_replace_label_type(
 *       tostring(call_arc_labeling),             # <<<<<<<<<<<<<<
 *       epsilon_on_replace)
 *   cdef fst.ReplaceLabelType _ral = _get_replace_label_type(
*/
  __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_call_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4502, __pyx_L1_error)

  /* "pywrapfst.pyx":4501
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(_pairs[0].second.ArcType()))
 *   cdef fst.ReplaceLabelType _cal = _get_replace_label_type(             # <<<<<<<<<<<<<<
 *       tostring(call_arc_labeling),
 *       epsilon_on_replace)
*/
  __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4501, __pyx_L1_error)
  __pyx_v__cal = __pyx_t_12;

  /* "pywrapfst.pyx":4505
 *       epsilon_on_replace)
 *   cdef fst.ReplaceLabelType _ral = _get_replace_label_type(
 *       tostring(return_arc_labeling),             # <<<<<<<<<<<<<<
 *       epsilon_on_replace)
 *   cdef unique_ptr[fst.ReplaceOptions] _opts
*/
  __pyx_t_11 = __pyx_f_9pywrapfst_tostring(__pyx_v_return_arc_labeling); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4505, __pyx_L1_error)

  /* "pywrapfst.pyx":4504
 *       tostring(call_arc_labeling),
 *       epsilon_on_replace)
 *   cdef fst.ReplaceLabelType _ral = _get_replace_label_type(             # <<<<<<<<<<<<<<
 *       tostring(return_arc_labeling),
 *       epsilon_on_replace)
*/
  __pyx_t_12 = __pyx_f_9pywrapfst__get_replace_label_type(__pyx_t_11, __pyx_v_epsilon_on_replace); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4504, __pyx_L1_error)
  __pyx_v__ral = __pyx_t_12;

  /* "pywrapfst.pyx":4508
 *       epsilon_on_replace)
 *   cdef unique_ptr[fst.ReplaceOptions] _opts
 *   _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _cal, _ral, return_label))             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.Replace(_pairs, _tfst.get(), deref(_opts))
*/
  __pyx_v__opts.reset(new fst::script::ReplaceOptions((__pyx_v__pairs[0]).first, __pyx_v__cal, __pyx_v__ral, __pyx_v_return_label));

  /* "pywrapfst.pyx":4509
 *   cdef unique_ptr[fst.ReplaceOptions] _opts
 *   _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _cal, _ral, return_label))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Replace(_pairs, _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4510
 *   _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _cal, _ral, return_label))
 *   with nogil:
 *     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":4509
 *   cdef unique_ptr[fst.ReplaceOptions] _opts
 *   _opts.reset(new fst.ReplaceOptions(_pairs[0].first, _cal, _ral, return_label))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Replace(_pairs, _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L10;
        }
        __pyx_L10:;
      }
  }

  /* "pywrapfst.pyx":4511
 *   with nogil:
 *     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, 4511, __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":4453
 * 
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__pfst);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_51replace(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_50replace, "\n  replace(pairs, call_arc_labeling=\"input\", return_arc_labeling=\"neither\",\n          epsilon_on_replace=False, return_label=0)\n\n  Recursively replaces arcs in the FST with other FST(s).\n\n  This operation performs the dynamic replacement of arcs in one FST with\n  another FST, allowing the definition of FSTs analogous to RTNs. It takes as\n  input a set of pairs of a set of pairs formed by a non-terminal label and\n  its corresponding FST, and a label identifying the root FST in that set.\n  The resulting FST is obtained by taking the root FST and recursively replacing\n  each arc having a nonterminal as output label by its corresponding FST. More\n  precisely, an arc from state s to state d with (nonterminal) output label n in\n  this FST is replaced by redirecting this \"call\" arc to the initial state of a\n  copy F of the FST for n, and adding \"return\" arcs from each final state of F\n  to d. Optional arguments control how the call and return arcs are labeled; by\n  default, the only non-epsilon label is placed on the call arc.\n\n  Args:\n\n    pairs: An iterable of (nonterminal label, FST) pairs, where the former is an\n        unsigned integer and the latter is an Fst instance.\n    call_arc_labeling: A string indicating which call arc labels should be\n        non-epsilon. One of: \"input\" (default), \"output\", \"both\", \"neither\".\n        This value is set to \"neither\" if epsilon_on_replace is True.\n    return_arc_labeling: A string indicating which return arc labels should be\n        non-epsilon. One of: \"input\", \"output\", \"both\", \"neither\" (default).\n        This value is set to \"neither\" if epsilon_on_replace is True.\n    epsilon_on_replace: Should call and return arcs be epsilon arcs? If True,\n        this effectively overrides call_arc_labeling and return_arc_labeling,\n        setting both to \"neither\".\n    return_label: The integer label for return arcs.\n\n  Returns:\n    An FST resulting from expanding the input"" RTN.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_51replace = {"replace", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_51replace, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_50replace};
static PyObject *__pyx_pw_9pywrapfst_51replace(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_pairs = 0;
  PyObject *__pyx_v_call_arc_labeling = 0;
  PyObject *__pyx_v_return_arc_labeling = 0;
  bool __pyx_v_epsilon_on_replace;
  int64_t __pyx_v_return_label;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("replace (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pairs,&__pyx_mstate_global->__pyx_n_u_call_arc_labeling,&__pyx_mstate_global->__pyx_n_u_return_arc_labeling,&__pyx_mstate_global->__pyx_n_u_epsilon_on_replace,&__pyx_mstate_global->__pyx_n_u_return_label,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4453, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "replace", 0) < 0) __PYX_ERR(0, 4453, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_input));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_neither));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, i); __PYX_ERR(0, 4453, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4453, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4453, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_input));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_neither));
    }
    __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, 4456, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4456
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
 *                          bool epsilon_on_replace=False,             # <<<<<<<<<<<<<<
 *                          int64_t return_label=0):
 *   """
*/
      __pyx_v_epsilon_on_replace = ((bool)0);
    }
    if (values[4]) {
      __pyx_v_return_label = __Pyx_PyLong_As_int64_t(values[4]); if (unlikely((__pyx_v_return_label == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4457, __pyx_L3_error)
    } else {
      __pyx_v_return_label = ((int64_t)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("replace", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 4453, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.replace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_50replace(__pyx_self, __pyx_v_pairs, __pyx_v_call_arc_labeling, __pyx_v_return_arc_labeling, __pyx_v_epsilon_on_replace, __pyx_v_return_label);

  /* "pywrapfst.pyx":4453
 * 
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
*/

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

static PyObject *__pyx_pf_9pywrapfst_50replace(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_pairs, PyObject *__pyx_v_call_arc_labeling, PyObject *__pyx_v_return_arc_labeling, bool __pyx_v_epsilon_on_replace, int64_t __pyx_v_return_label) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_9pywrapfst_replace __pyx_t_2;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("replace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.call_arc_labeling = __pyx_v_call_arc_labeling;
  __pyx_t_2.return_arc_labeling = __pyx_v_return_arc_labeling;
  __pyx_t_2.epsilon_on_replace = __pyx_v_epsilon_on_replace;
  __pyx_t_2.return_label = __pyx_v_return_label;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_replace(__pyx_v_pairs, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4453, __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":4514
 * 
 * 
 * cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
 *   """
 *   reverse(ifst, require_superinitial=True)
*/

static PyObject *__pyx_pw_9pywrapfst_53reverse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reverse", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_require_superinitial = __pyx_optional_args->require_superinitial;
    }
  }

  /* "pywrapfst.pyx":4534
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4534, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4534, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4535
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4536
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   with nogil:
 *     fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4536, __pyx_L4_error)
        }
        fst::script::Reverse((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), __pyx_v_require_superinitial);
      }

      /* "pywrapfst.pyx":4535
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4537
 *   with nogil:
 *     fst.Reverse(deref(ifst._fst), _tfst.get(), require_superinitial)
 *   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, 4537, __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":4514
 * 
 * 
 * cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
 *   """
 *   reverse(ifst, require_superinitial=True)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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_53reverse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_52reverse, "\n  reverse(ifst, require_superinitial=True)\n\n  Constructively reverses an FST's transduction.\n\n  This operation reverses an FST. If A transduces string x to y with weight a,\n  then the reverse of A transduces the reverse of x to the reverse of y with\n  weight a.Reverse(). (Typically, a = a.Reverse() and Arc = RevArc, e.g.,\n  TropicalWeight and LogWeight.) In general, e.g., when the weights only form a\n  left or right semiring, the output arc type must match the input arc type.\n\n  Args:\n    ifst: The input FST.\n    require_superinitial: Should a superinitial state be created?\n\n  Returns:\n    A reversed FST.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_53reverse = {"reverse", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_53reverse, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_52reverse};
static PyObject *__pyx_pw_9pywrapfst_53reverse(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  bool __pyx_v_require_superinitial;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reverse (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_require_superinitial,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4514, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4514, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4514, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "reverse", 0) < 0) __PYX_ERR(0, 4514, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, i); __PYX_ERR(0, 4514, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4514, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4514, __pyx_L3_error)
        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, 4514, __pyx_L3_error)
    } else {
      __pyx_v_require_superinitial = ((bool)1);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reverse", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 4514, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4514, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_52reverse(__pyx_self, __pyx_v_ifst, __pyx_v_require_superinitial);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_52reverse(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reverse", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.require_superinitial = __pyx_v_require_superinitial;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_reverse(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4514, __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":4543
 * 
 * 
 * cdef void _shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                             vector[fst.WeightClass] *distance,
 *                             float delta=fst.kShortestDelta,
*/

static void __pyx_f_9pywrapfst__shortestdistance(struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, std::vector<fst::script::WeightClass>  *__pyx_v_distance, struct __pyx_opt_args_9pywrapfst__shortestdistance *__pyx_optional_args) {
  float __pyx_v_delta = __pyx_mstate_global->__pyx_k__36;
  int64_t __pyx_v_nstate = __pyx_mstate_global->__pyx_k__37;
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_auto);

  /* "pywrapfst.pyx":4548
 *                             int64_t nstate=fst.kNoStateId,
 *                             queue_type="auto",
 *                             bool reverse=False) except *:             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ShortestDistanceOptions] _opts
 *   if reverse:
*/
  bool __pyx_v_reverse = ((bool)0);
  std::unique_ptr<fst::script::ShortestDistanceOptions>  __pyx_v__opts;
  int __pyx_t_1;
  std::string __pyx_t_2;
  enum fst::QueueType __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  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":4550
 *                             bool reverse=False) except *:
 *   cdef unique_ptr[fst.ShortestDistanceOptions] _opts
 *   if reverse:             # <<<<<<<<<<<<<<
 *     # Only the simpler signature supports shortest distance to final states;
 *     # `nstate` and `queue_type` arguments are ignored.
*/
  __pyx_t_1 = (__pyx_v_reverse != 0);
  if (__pyx_t_1) {

    /* "pywrapfst.pyx":4553
 *     # Only the simpler signature supports shortest distance to final states;
 *     # `nstate` and `queue_type` arguments are ignored.
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
 *   else:
*/
    {
        PyThreadState *_save;
        _save = NULL;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pywrapfst.pyx":4554
 *     # `nstate` and `queue_type` arguments are ignored.
 *     with nogil:
 *       fst.ShortestDistance(deref(ifst._fst), distance, True, delta)             # <<<<<<<<<<<<<<
 *   else:
 *     _opts.reset(
*/
          if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            __PYX_ERR(0, 4554, __pyx_L5_error)
          }
          fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, 1, __pyx_v_delta);
        }

        /* "pywrapfst.pyx":4553
 *     # Only the simpler signature supports shortest distance to final states;
 *     # `nstate` and `queue_type` arguments are ignored.
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
 *   else:
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L6;
          }
          __pyx_L5_error: {
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L1_error;
          }
          __pyx_L6:;
        }
    }

    /* "pywrapfst.pyx":4550
 *                             bool reverse=False) except *:
 *   cdef unique_ptr[fst.ShortestDistanceOptions] _opts
 *   if reverse:             # <<<<<<<<<<<<<<
 *     # Only the simpler signature supports shortest distance to final states;
 *     # `nstate` and `queue_type` arguments are ignored.
*/
    goto __pyx_L3;
  }

  /* "pywrapfst.pyx":4556
 *       fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
 *   else:
 *     _opts.reset(             # <<<<<<<<<<<<<<
 *         new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)),
 *                                         fst.ArcFilterType.ANY_ARC_FILTER,
*/
  /*else*/ {

    /* "pywrapfst.pyx":4557
 *   else:
 *     _opts.reset(
 *         new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)),             # <<<<<<<<<<<<<<
 *                                         fst.ArcFilterType.ANY_ARC_FILTER,
 *                                         nstate,
*/
    __pyx_t_2 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4557, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4557, __pyx_L1_error)

    /* "pywrapfst.pyx":4556
 *       fst.ShortestDistance(deref(ifst._fst), distance, True, delta)
 *   else:
 *     _opts.reset(             # <<<<<<<<<<<<<<
 *         new fst.ShortestDistanceOptions(_get_queue_type(tostring(queue_type)),
 *                                         fst.ArcFilterType.ANY_ARC_FILTER,
*/
    __pyx_v__opts.reset(new fst::script::ShortestDistanceOptions(__pyx_t_3, fst::script::ArcFilterType::ANY, __pyx_v_nstate, __pyx_v_delta));

    /* "pywrapfst.pyx":4561
 *                                         nstate,
 *                                         delta))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.ShortestDistance(deref(ifst._fst), distance, deref(_opts))
 * 
*/
    {
        PyThreadState *_save;
        _save = NULL;
        Py_UNBLOCK_THREADS
        __Pyx_FastGIL_Remember();
        /*try:*/ {

          /* "pywrapfst.pyx":4562
 *                                         delta))
 *     with nogil:
 *       fst.ShortestDistance(deref(ifst._fst), distance, deref(_opts))             # <<<<<<<<<<<<<<
 * 
 * 
*/
          if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
            PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
            __Pyx_PyGILState_Release(__pyx_gilstate_save);
            __PYX_ERR(0, 4562, __pyx_L8_error)
          }
          fst::script::ShortestDistance((*__pyx_v_ifst->_fst), __pyx_v_distance, (*__pyx_v__opts));
        }

        /* "pywrapfst.pyx":4561
 *                                         nstate,
 *                                         delta))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       fst.ShortestDistance(deref(ifst._fst), distance, deref(_opts))
 * 
*/
        /*finally:*/ {
          /*normal exit:*/{
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L9;
          }
          __pyx_L8_error: {
            __Pyx_FastGIL_Forget();
            Py_BLOCK_THREADS
            goto __pyx_L1_error;
          }
          __pyx_L9:;
        }
    }
  }
  __pyx_L3:;

  /* "pywrapfst.pyx":4543
 * 
 * 
 * cdef void _shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                             vector[fst.WeightClass] *distance,
 *                             float delta=fst.kShortestDelta,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pywrapfst._shortestdistance", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":4565
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64_t nstate=fst.kNoStateId,
*/

static PyObject *__pyx_pf_9pywrapfst_62__defaults__(CYTHON_UNUSED PyObject *__pyx_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(__Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self)->arg1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":4569
 *                      int64_t nstate=fst.kNoStateId,
 *                      queue_type="auto",
 *                      bool reverse=False):             # <<<<<<<<<<<<<<
 *   """
 *   shortestdistance(ifst, delta=1e-6, nstate=NO_STATE_ID,
*/
  __pyx_t_3 = __Pyx_PyBool_FromLong(((int)0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "pywrapfst.pyx":4565
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64_t nstate=fst.kNoStateId,
*/
  __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1) != (0)) __PYX_ERR(0, 4565, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_2);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2) != (0)) __PYX_ERR(0, 4565, __pyx_L1_error);
  __Pyx_INCREF(((PyObject*)__pyx_mstate_global->__pyx_n_u_auto));
  __Pyx_GIVEREF(((PyObject*)__pyx_mstate_global->__pyx_n_u_auto));
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 2, ((PyObject*)__pyx_mstate_global->__pyx_n_u_auto)) != (0)) __PYX_ERR(0, 4565, __pyx_L1_error);
  __Pyx_GIVEREF(__pyx_t_3);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_t_3) != (0)) __PYX_ERR(0, 4565, __pyx_L1_error);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 4565, __pyx_L1_error);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_3, 1, Py_None) != (0)) __PYX_ERR(0, 4565, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_55shortestdistance(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_54shortestdistance, "\n  shortestdistance(ifst, delta=1e-6, nstate=NO_STATE_ID,\n                   queue_type=\"auto\", reverse=False)\n\n  Compute the shortest distance from the initial or final state.\n\n  This operation computes the shortest distance from the initial state (when\n  `reverse` is False) or from every state to the final state (when `reverse` is\n  True). The shortest distance from p to q is the \\otimes-sum of the weights of\n  all the paths between p and q. The weights must be right (if `reverse` is\n  False) or left (if `reverse` is True) distributive, and k-closed (i.e., 1\n  \\otimes x \\otimes x^2 \\otimes ... \\otimes x^{k + 1} = 1 \\otimes x \\otimes x^2\n  \\otimes ... \\otimes x^k; e.g., TropicalWeight).\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    nstate: State number threshold (ignored if `reverse` is True).\n    queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n        \"lifo\", \"shortest\", \"state\", \"top\" (ignored if `reverse` is True).\n    reverse: Should the reverse distance (from each state to the final state)\n        be computed?\n\n  Returns:\n    A list of Weight objects representing the shortest distance for each state.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_55shortestdistance = {"shortestdistance", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_55shortestdistance, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_54shortestdistance};
static PyObject *__pyx_pw_9pywrapfst_55shortestdistance(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  int64_t __pyx_v_nstate;
  PyObject *__pyx_v_queue_type = 0;
  bool __pyx_v_reverse;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[5] = {0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shortestdistance (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_nstate,&__pyx_mstate_global->__pyx_n_u_queue_type,&__pyx_mstate_global->__pyx_n_u_reverse,0};
    struct __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_self);
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4565, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "shortestdistance", 0) < 0) __PYX_ERR(0, 4565, __pyx_L3_error)
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_auto)));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, i); __PYX_ERR(0, 4565, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4565, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4565, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[3]) values[3] = __Pyx_NewRef(((PyObject *)((PyObject*)__pyx_mstate_global->__pyx_n_u_auto)));
    }
    __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, 4566, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_dynamic_args->arg0;
    }
    if (values[2]) {
      __pyx_v_nstate = __Pyx_PyLong_As_int64_t(values[2]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4567, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_dynamic_args->arg1;
    }
    __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, 4569, __pyx_L3_error)
    } else {
      __pyx_v_reverse = ((bool)((int)0));
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shortestdistance", 0, 1, 5, __pyx_nargs); __PYX_ERR(0, 4565, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4565, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_54shortestdistance(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_reverse);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_54shortestdistance(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int64_t __pyx_v_nstate, PyObject *__pyx_v_queue_type, bool __pyx_v_reverse) {
  std::vector<fst::script::WeightClass>  __pyx_v__distance;
  fst::script::WeightClass __pyx_7genexpr__pyx_v_weight;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_9pywrapfst__shortestdistance __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  std::vector<fst::script::WeightClass> ::iterator __pyx_t_3;
  fst::script::WeightClass __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shortestdistance", 0);

  /* "pywrapfst.pyx":4597
 *   """
 *   cdef vector[fst.WeightClass] _distance
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)             # <<<<<<<<<<<<<<
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())
 *           for weight in _distance]
*/
  __pyx_t_1.__pyx_n = 4;
  __pyx_t_1.delta = __pyx_v_delta;
  __pyx_t_1.nstate = __pyx_v_nstate;
  __pyx_t_1.queue_type = __pyx_v_queue_type;
  __pyx_t_1.reverse = __pyx_v_reverse;
  __pyx_f_9pywrapfst__shortestdistance(__pyx_v_ifst, (&__pyx_v__distance), &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4597, __pyx_L1_error)

  /* "pywrapfst.pyx":4598
 *   cdef vector[fst.WeightClass] _distance
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())             # <<<<<<<<<<<<<<
 *           for weight in _distance]
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "pywrapfst.pyx":4599
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())
 *           for weight in _distance]             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __pyx_t_3 = __pyx_v__distance.begin();
    for (; __pyx_t_3 != __pyx_v__distance.end(); ++__pyx_t_3) {
      __pyx_t_4 = *__pyx_t_3;
      __pyx_7genexpr__pyx_v_weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);

      /* "pywrapfst.pyx":4598
 *   cdef vector[fst.WeightClass] _distance
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())             # <<<<<<<<<<<<<<
 *           for weight in _distance]
 * 
*/
      __pyx_t_6 = NULL;
      __Pyx_INCREF((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight);
      __pyx_t_7 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight); 
      if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
        __PYX_ERR(0, 4598, __pyx_L1_error)
      }
      __pyx_t_8 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v_ifst->_fst.get()->WeightType()); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_7genexpr__pyx_v_weight.ToString()); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4598, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_8, __pyx_t_9};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_10, (3-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4598, __pyx_L1_error)
        __Pyx_GOTREF((PyObject *)__pyx_t_5);
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 4598, __pyx_L1_error)
      __Pyx_DECREF((PyObject *)__pyx_t_5); __pyx_t_5 = 0;

      /* "pywrapfst.pyx":4599
 *   _shortestdistance(ifst, addr(_distance), delta, nstate, queue_type, reverse)
 *   return [Weight(ifst._fst.get().WeightType(), weight.ToString())
 *           for weight in _distance]             # <<<<<<<<<<<<<<
 * 
 * 
*/
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4565
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64_t nstate=fst.kNoStateId,
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __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":4602
 * 
 * 
 * cpdef MutableFst shortestpath(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               int32_t nshortest=1,
*/

static PyObject *__pyx_pw_9pywrapfst_57shortestpath(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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_mstate_global->__pyx_k__38;
  int32_t __pyx_v_nshortest = ((int32_t)1);
  int64_t __pyx_v_nstate = __pyx_mstate_global->__pyx_k__39;
  PyObject *__pyx_v_queue_type = ((PyObject *)__pyx_mstate_global->__pyx_n_u_auto);

  /* "pywrapfst.pyx":4607
 *                               int64_t nstate=fst.kNoStateId,
 *                               queue_type="auto",
 *                               bool unique=False,             # <<<<<<<<<<<<<<
 *                               weight=None):
 *   """
*/
  bool __pyx_v_unique = ((bool)0);

  /* "pywrapfst.pyx":4608
 *                               queue_type="auto",
 *                               bool unique=False,
 *                               weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   shortestpath(ifst, delta=1e-6, nshortest=1, nstate=NO_STATE_ID,
*/
  PyObject *__pyx_v_weight = ((PyObject *)Py_None);
  std::unique_ptr<fst::script::VectorFstClass>  __pyx_v__tfst;
  fst::script::WeightClass __pyx_v__weight;
  std::unique_ptr<fst::script::ShortestPathOptions>  __pyx_v__opts;
  struct __pyx_obj_9pywrapfst_MutableFst *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::script::WeightClass __pyx_t_2;
  enum fst::QueueType __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shortestpath", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_delta = __pyx_optional_args->delta;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_nshortest = __pyx_optional_args->nshortest;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_nstate = __pyx_optional_args->nstate;
          if (__pyx_optional_args->__pyx_n > 3) {
            __pyx_v_queue_type = __pyx_optional_args->queue_type;
            if (__pyx_optional_args->__pyx_n > 4) {
              __pyx_v_unique = __pyx_optional_args->unique;
              if (__pyx_optional_args->__pyx_n > 5) {
                __pyx_v_weight = __pyx_optional_args->weight;
              }
            }
          }
        }
      }
    }
  }

  /* "pywrapfst.pyx":4640
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4640, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4640, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4642
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),             # <<<<<<<<<<<<<<
 *                                                           weight)
 *   cdef unique_ptr[fst.ShortestPathOptions] _opts
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "weight_type");
    __PYX_ERR(0, 4642, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->weight_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4642, __pyx_L1_error)

  /* "pywrapfst.pyx":4643
 *   # Threshold is set to semiring Zero (no pruning) if no weight is specified.
 *   cdef fst.WeightClass _weight = _get_WeightClass_or_zero(ifst.weight_type(),
 *                                                           weight)             # <<<<<<<<<<<<<<
 *   cdef unique_ptr[fst.ShortestPathOptions] _opts
 *   _opts.reset(
*/
  __pyx_t_2 = __pyx_f_9pywrapfst__get_WeightClass_or_zero(__pyx_t_1, __pyx_v_weight); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4642, __pyx_L1_error)
  __pyx_v__weight = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);

  /* "pywrapfst.pyx":4646
 *   cdef unique_ptr[fst.ShortestPathOptions] _opts
 *   _opts.reset(
 *       new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),             # <<<<<<<<<<<<<<
 *                                   nshortest,
 *                                   unique,
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_queue_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4646, __pyx_L1_error)
  __pyx_t_3 = __pyx_f_9pywrapfst__get_queue_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4646, __pyx_L1_error)

  /* "pywrapfst.pyx":4645
 *                                                           weight)
 *   cdef unique_ptr[fst.ShortestPathOptions] _opts
 *   _opts.reset(             # <<<<<<<<<<<<<<
 *       new fst.ShortestPathOptions(_get_queue_type(tostring(queue_type)),
 *                                   nshortest,
*/
  __pyx_v__opts.reset(new fst::script::ShortestPathOptions(__pyx_t_3, __pyx_v_nshortest, __pyx_v_unique, __pyx_v_delta, __pyx_v__weight, __pyx_v_nstate));

  /* "pywrapfst.pyx":4652
 *                                   _weight,
 *                                   nstate))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.ShortestPath(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4653
 *                                   nstate))
 *   with nogil:
 *     fst.ShortestPath(deref(ifst._fst), _tfst.get(), deref(_opts))             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4653, __pyx_L4_error)
        }
        fst::script::ShortestPath((*__pyx_v_ifst->_fst), __pyx_v__tfst.get(), (*__pyx_v__opts));
      }

      /* "pywrapfst.pyx":4652
 *                                   _weight,
 *                                   nstate))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.ShortestPath(deref(ifst._fst), _tfst.get(), deref(_opts))
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4654
 *   with nogil:
 *     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, 4654, __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":4602
 * 
 * 
 * cpdef MutableFst shortestpath(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               int32_t 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_57shortestpath(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_56shortestpath, "\n  shortestpath(ifst, delta=1e-6, nshortest=1, nstate=NO_STATE_ID,\n               queue_type=\"auto\", unique=False, weight=None)\n\n  Construct an FST containing the shortest path(s) in the input FST.\n\n  This operation produces an FST containing the n-shortest paths in the input\n  FST. The n-shortest paths are the n-lowest weight paths w.r.t. the natural\n  semiring order. The single path that can be read from the ith of at most n\n  transitions leaving the initial state of the resulting FST is the ith\n  shortest path. The weights need to be right distributive and have the path\n  property. They also need to be left distributive as well for n-shortest with\n  n > 1 (e.g., TropicalWeight).\n\n  Args:\n    ifst: The input FST.\n    delta: Comparison/quantization delta.\n    nshortest: The number of paths to return.\n    nstate: State number threshold.\n    queue_type: A string matching a known queue type; one of: \"auto\", \"fifo\",\n        \"lifo\", \"shortest\", \"state\", \"top\".\n    unique: Should the resulting FST only contain distinct paths? (Requires\n        the input FST to be an acceptor; epsilons are treated as if they are\n        regular symbols.)\n    weight: A Weight or weight string indicating the desired weight threshold\n        below which paths are pruned; if omitted, no paths are pruned.\n\n  Returns:\n    An FST containing the n-shortest paths.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_57shortestpath = {"shortestpath", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_57shortestpath, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_56shortestpath};
static PyObject *__pyx_pw_9pywrapfst_57shortestpath(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  float __pyx_v_delta;
  int32_t __pyx_v_nshortest;
  int64_t __pyx_v_nstate;
  PyObject *__pyx_v_queue_type = 0;
  bool __pyx_v_unique;
  PyObject *__pyx_v_weight = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[7] = {0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("shortestpath (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_delta,&__pyx_mstate_global->__pyx_n_u_nshortest,&__pyx_mstate_global->__pyx_n_u_nstate,&__pyx_mstate_global->__pyx_n_u_queue_type,&__pyx_mstate_global->__pyx_n_u_unique,&__pyx_mstate_global->__pyx_n_u_weight,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4602, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "shortestpath", 0) < 0) __PYX_ERR(0, 4602, __pyx_L3_error)
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));

      /* "pywrapfst.pyx":4608
 *                               queue_type="auto",
 *                               bool unique=False,
 *                               weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   shortestpath(ifst, delta=1e-6, nshortest=1, nstate=NO_STATE_ID,
*/
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, i); __PYX_ERR(0, 4602, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  7:
        values[6] = __Pyx_ArgRef_FASTCALL(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_FASTCALL(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_FASTCALL(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4602, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4602, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[4]) values[4] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_auto));
      if (!values[6]) values[6] = __Pyx_NewRef(((PyObject *)Py_None));
    }
    __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, 4603, __pyx_L3_error)
    } else {
      __pyx_v_delta = __pyx_mstate_global->__pyx_k__38;
    }
    if (values[2]) {
      __pyx_v_nshortest = __Pyx_PyLong_As_int32_t(values[2]); if (unlikely((__pyx_v_nshortest == ((int32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4604, __pyx_L3_error)
    } else {
      __pyx_v_nshortest = ((int32_t)1);
    }
    if (values[3]) {
      __pyx_v_nstate = __Pyx_PyLong_As_int64_t(values[3]); if (unlikely((__pyx_v_nstate == ((int64_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4605, __pyx_L3_error)
    } else {
      __pyx_v_nstate = __pyx_mstate_global->__pyx_k__39;
    }
    __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, 4607, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4607
 *                               int64_t nstate=fst.kNoStateId,
 *                               queue_type="auto",
 *                               bool unique=False,             # <<<<<<<<<<<<<<
 *                               weight=None):
 *   """
*/
      __pyx_v_unique = ((bool)0);
    }
    __pyx_v_weight = values[6];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("shortestpath", 0, 1, 7, __pyx_nargs); __PYX_ERR(0, 4602, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4602, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_56shortestpath(__pyx_self, __pyx_v_ifst, __pyx_v_delta, __pyx_v_nshortest, __pyx_v_nstate, __pyx_v_queue_type, __pyx_v_unique, __pyx_v_weight);

  /* "pywrapfst.pyx":4602
 * 
 * 
 * cpdef MutableFst shortestpath(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               int32_t nshortest=1,
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_56shortestpath(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst, float __pyx_v_delta, int32_t __pyx_v_nshortest, int64_t __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("shortestpath", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 6;
  __pyx_t_2.delta = __pyx_v_delta;
  __pyx_t_2.nshortest = __pyx_v_nshortest;
  __pyx_t_2.nstate = __pyx_v_nstate;
  __pyx_t_2.queue_type = __pyx_v_queue_type;
  __pyx_t_2.unique = __pyx_v_unique;
  __pyx_t_2.weight = __pyx_v_weight;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_shortestpath(__pyx_v_ifst, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4602, __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":4657
 * 
 * 
 * cpdef Fst statemap(Fst ifst, map_type):             # <<<<<<<<<<<<<<
 *   """
 *   state_map(ifst, map_type)
*/

static PyObject *__pyx_pw_9pywrapfst_59statemap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("statemap", 0);

  /* "pywrapfst.pyx":4680
 *     FstArgError: Unknown map type.
 *   """
 *   return _map(ifst, fst.kDelta, map_type, 1., None)             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_2.__pyx_n = 4;
  __pyx_t_2.delta = fst::kDelta;
  __pyx_t_2.map_type = __pyx_v_map_type;
  __pyx_t_2.power = 1.;
  __pyx_t_2.weight = Py_None;
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__map(__pyx_v_ifst, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4680, __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":4657
 * 
 * 
 * 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_59statemap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_58statemap, "\n  state_map(ifst, map_type)\n\n  Constructively applies a transform to all states.\n\n  This operation transforms each state using one of the following:\n\n    * arc_sum: sums weights of identically-labeled multi-arcs.\n    * arc_unique: deletes non-unique identically-labeled multi-arcs.\n    * identity: maps to self.\n\n  Args:\n    ifst: The input FST.\n    map_type: A string matching a known mapping operation; one of: \"arc_sum\",\n        \"arc_unique\", \"identity\".\n\n  Returns:\n    An FST with states remapped.\n\n  Raises:\n    FstArgError: Unknown map type.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_59statemap = {"statemap", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_59statemap, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_58statemap};
static PyObject *__pyx_pw_9pywrapfst_59statemap(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  PyObject *__pyx_v_map_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("statemap (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,&__pyx_mstate_global->__pyx_n_u_map_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4657, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4657, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4657, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "statemap", 0) < 0) __PYX_ERR(0, 4657, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, i); __PYX_ERR(0, 4657, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4657, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4657, __pyx_L3_error)
    }
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_Fst *)values[0]);
    __pyx_v_map_type = values[1];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("statemap", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 4657, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4657, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_58statemap(__pyx_self, __pyx_v_ifst, __pyx_v_map_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_58statemap(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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("statemap", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_statemap(__pyx_v_ifst, __pyx_v_map_type, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4657, __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":4683
 * 
 * 
 * cpdef MutableFst synchronize(Fst ifst):             # <<<<<<<<<<<<<<
 *   """
 *   synchronize(ifst)
*/

static PyObject *__pyx_pw_9pywrapfst_61synchronize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("synchronize", 0);

  /* "pywrapfst.pyx":4703
 *   """
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))             # <<<<<<<<<<<<<<
 *   with nogil:
 *     fst.Synchronize(deref(ifst._fst), _tfst.get())
*/
  if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "arc_type");
    __PYX_ERR(0, 4703, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_Fst *)__pyx_v_ifst->__pyx_vtab)->arc_type(__pyx_v_ifst, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4703, __pyx_L1_error)
  __pyx_v__tfst.reset(new fst::script::VectorFstClass(__pyx_t_1));

  /* "pywrapfst.pyx":4704
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Synchronize(deref(ifst._fst), _tfst.get())
 *   return _init_MutableFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4705
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   with nogil:
 *     fst.Synchronize(deref(ifst._fst), _tfst.get())             # <<<<<<<<<<<<<<
 *   return _init_MutableFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4705, __pyx_L4_error)
        }
        fst::script::Synchronize((*__pyx_v_ifst->_fst), __pyx_v__tfst.get());
      }

      /* "pywrapfst.pyx":4704
 *   cdef unique_ptr[fst.VectorFstClass] _tfst
 *   _tfst.reset(new fst.VectorFstClass(ifst.arc_type()))
 *   with nogil:             # <<<<<<<<<<<<<<
 *     fst.Synchronize(deref(ifst._fst), _tfst.get())
 *   return _init_MutableFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4706
 *   with nogil:
 *     fst.Synchronize(deref(ifst._fst), _tfst.get())
 *   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, 4706, __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":4683
 * 
 * 
 * cpdef MutableFst synchronize(Fst ifst):             # <<<<<<<<<<<<<<
 *   """
 *   synchronize(ifst)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __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_61synchronize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_60synchronize, "\n  synchronize(ifst)\n\n  Constructively synchronizes an FST.\n\n  This operation synchronizes a transducer. The result will be an equivalent\n  FST that has the property that during the traversal of a path, the delay is\n  either zero or strictly increasing, where the delay is the difference between\n  the number of non-epsilon output labels and input labels along the path. For\n  the algorithm to terminate, the input transducer must have bounded delay,\n  i.e., the delay of every cycle must be zero.\n\n  Args:\n    ifst: The input FST.\n\n  Returns:\n    An equivalent synchronized FST.\n  ");
static PyMethodDef __pyx_mdef_9pywrapfst_61synchronize = {"synchronize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_61synchronize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_60synchronize};
static PyObject *__pyx_pw_9pywrapfst_61synchronize(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("synchronize (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_ifst,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4683, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4683, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "synchronize", 0) < 0) __PYX_ERR(0, 4683, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("synchronize", 1, 1, 1, i); __PYX_ERR(0, 4683, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4683, __pyx_L3_error)
    }
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_Fst *)values[0]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("synchronize", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4683, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.synchronize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ifst), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 4683, __pyx_L1_error)
  __pyx_r = __pyx_pf_9pywrapfst_60synchronize(__pyx_self, __pyx_v_ifst);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9pywrapfst_60synchronize(CYTHON_UNUSED PyObject *__pyx_self, struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("synchronize", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_synchronize(__pyx_v_ifst, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4683, __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":4760
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 str fst_type="vector",
 *                 str arc_type="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) {
  PyObject *__pyx_v_fst_type = 0;
  PyObject *__pyx_v_arc_type = 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;
  bool __pyx_v_keep_isymbols;
  bool __pyx_v_keep_osymbols;
  bool __pyx_v_keep_state_numbering;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_fst_type,&__pyx_mstate_global->__pyx_n_u_arc_type,&__pyx_mstate_global->__pyx_n_u_isymbols,&__pyx_mstate_global->__pyx_n_u_osymbols,&__pyx_mstate_global->__pyx_n_u_ssymbols,&__pyx_mstate_global->__pyx_n_u_acceptor,&__pyx_mstate_global->__pyx_n_u_keep_isymbols,&__pyx_mstate_global->__pyx_n_u_keep_osymbols,&__pyx_mstate_global->__pyx_n_u_keep_state_numbering,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4760, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__cinit__", 0) < 0) __PYX_ERR(0, 4760, __pyx_L3_error)
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_vector));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_standard));

      /* "pywrapfst.pyx":4763
 *                 str fst_type="vector",
 *                 str arc_type="standard",
 *                 SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None));

      /* "pywrapfst.pyx":4764
 *                 str arc_type="standard",
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,             # <<<<<<<<<<<<<<
 *                 SymbolTable ssymbols=None,
 *                 bool acceptor=False,
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None));

      /* "pywrapfst.pyx":4765
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
 *                 bool acceptor=False,
 *                 bool keep_isymbols=False,
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None));
    } else {
      switch (__pyx_nargs) {
        case  9:
        values[8] = __Pyx_ArgRef_VARARGS(__pyx_args, 8);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[8])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  8:
        values[7] = __Pyx_ArgRef_VARARGS(__pyx_args, 7);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[7])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  7:
        values[6] = __Pyx_ArgRef_VARARGS(__pyx_args, 6);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[6])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  6:
        values[5] = __Pyx_ArgRef_VARARGS(__pyx_args, 5);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[5])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  5:
        values[4] = __Pyx_ArgRef_VARARGS(__pyx_args, 4);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[4])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  4:
        values[3] = __Pyx_ArgRef_VARARGS(__pyx_args, 3);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  3:
        values[2] = __Pyx_ArgRef_VARARGS(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_VARARGS(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4760, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[0]) values[0] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_vector));
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject*)__pyx_mstate_global->__pyx_n_u_standard));

      /* "pywrapfst.pyx":4763
 *                 str fst_type="vector",
 *                 str arc_type="standard",
 *                 SymbolTable isymbols=None,             # <<<<<<<<<<<<<<
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,
*/
      if (!values[2]) values[2] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None));

      /* "pywrapfst.pyx":4764
 *                 str arc_type="standard",
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,             # <<<<<<<<<<<<<<
 *                 SymbolTable ssymbols=None,
 *                 bool acceptor=False,
*/
      if (!values[3]) values[3] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None));

      /* "pywrapfst.pyx":4765
 *                 SymbolTable isymbols=None,
 *                 SymbolTable osymbols=None,
 *                 SymbolTable ssymbols=None,             # <<<<<<<<<<<<<<
 *                 bool acceptor=False,
 *                 bool keep_isymbols=False,
*/
      if (!values[4]) values[4] = __Pyx_NewRef((PyObject *)((struct __pyx_obj_9pywrapfst_SymbolTable *)Py_None));
    }
    __pyx_v_fst_type = ((PyObject*)values[0]);
    __pyx_v_arc_type = ((PyObject*)values[1]);
    __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, 4766, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4766
 *                 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, 4767, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4767
 *                 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, 4768, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4768
 *                 bool acceptor=False,
 *                 bool keep_isymbols=False,
 *                 bool keep_osymbols=False,             # <<<<<<<<<<<<<<
 *                 bool keep_state_numbering=False):
 *     self._sstrm.reset(new stringstream())
*/
      __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, 4769, __pyx_L3_error)
    } else {

      /* "pywrapfst.pyx":4769
 *                 bool keep_isymbols=False,
 *                 bool keep_osymbols=False,
 *                 bool keep_state_numbering=False):             # <<<<<<<<<<<<<<
 *     self._sstrm.reset(new stringstream())
 *     self._fst_type = tostring(fst_type)
*/
      __pyx_v_keep_state_numbering = ((bool)0);
    }
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 9, __pyx_nargs); __PYX_ERR(0, 4760, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_fst_type), (&PyUnicode_Type), 1, "fst_type", 1))) __PYX_ERR(0, 4761, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arc_type), (&PyUnicode_Type), 1, "arc_type", 1))) __PYX_ERR(0, 4762, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_isymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, 1, "isymbols", 0))) __PYX_ERR(0, 4763, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_osymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, 1, "osymbols", 0))) __PYX_ERR(0, 4764, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ssymbols), __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, 1, "ssymbols", 0))) __PYX_ERR(0, 4765, __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);

  /* "pywrapfst.pyx":4760
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 str fst_type="vector",
 *                 str arc_type="standard",
*/

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9pywrapfst_8Compiler___cinit__(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_fst_type, PyObject *__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) {
  int __pyx_r;
  std::string __pyx_t_1;
  int __pyx_t_2;
  fst::SymbolTable const *__pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":4770
 *                 bool keep_osymbols=False,
 *                 bool keep_state_numbering=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, 4770, __pyx_L1_error)
  }
  __pyx_v_self->_sstrm.reset(new std::stringstream());

  /* "pywrapfst.pyx":4771
 *                 bool keep_state_numbering=False):
 *     self._sstrm.reset(new stringstream())
 *     self._fst_type = tostring(fst_type)             # <<<<<<<<<<<<<<
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_fst_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4771, __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, 4771, __pyx_L1_error)
  }
  __pyx_v_self->_fst_type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":4772
 *     self._sstrm.reset(new stringstream())
 *     self._fst_type = tostring(fst_type)
 *     self._arc_type = tostring(arc_type)             # <<<<<<<<<<<<<<
 *     self._isymbols = NULL
 *     if isymbols is not None:
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4772, __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, 4772, __pyx_L1_error)
  }
  __pyx_v_self->_arc_type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":4773
 *     self._fst_type = tostring(fst_type)
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL             # <<<<<<<<<<<<<<
 *     if isymbols is not None:
 *       self._isymbols = isymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
    __PYX_ERR(0, 4773, __pyx_L1_error)
  }
  __pyx_v_self->_isymbols = NULL;

  /* "pywrapfst.pyx":4774
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_isymbols) != Py_None);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":4775
 *     self._isymbols = NULL
 *     if isymbols is not None:
 *       self._isymbols = isymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     self._osymbols = NULL
 *     if osymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_isymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 4775, __pyx_L1_error)
    }
    __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_isymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_isymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4775, __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, 4775, __pyx_L1_error)
    }
    __pyx_v_self->_isymbols = __pyx_t_3;

    /* "pywrapfst.pyx":4774
 *     self._arc_type = tostring(arc_type)
 *     self._isymbols = NULL
 *     if isymbols is not None:             # <<<<<<<<<<<<<<
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL
*/
  }

  /* "pywrapfst.pyx":4776
 *     if isymbols is not None:
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL             # <<<<<<<<<<<<<<
 *     if osymbols is not None:
 *       self._osymbols = osymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
    __PYX_ERR(0, 4776, __pyx_L1_error)
  }
  __pyx_v_self->_osymbols = NULL;

  /* "pywrapfst.pyx":4777
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_osymbols) != Py_None);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":4778
 *     self._osymbols = NULL
 *     if osymbols is not None:
 *       self._osymbols = osymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     self._ssymbols = NULL
 *     if ssymbols is not None:
*/
    if (unlikely(((PyObject *)__pyx_v_osymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 4778, __pyx_L1_error)
    }
    __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_osymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_osymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4778, __pyx_L1_error)
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
      __PYX_ERR(0, 4778, __pyx_L1_error)
    }
    __pyx_v_self->_osymbols = __pyx_t_3;

    /* "pywrapfst.pyx":4777
 *       self._isymbols = isymbols._raw_ptr_or_raise()
 *     self._osymbols = NULL
 *     if osymbols is not None:             # <<<<<<<<<<<<<<
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL
*/
  }

  /* "pywrapfst.pyx":4779
 *     if osymbols is not None:
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL             # <<<<<<<<<<<<<<
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
    __PYX_ERR(0, 4779, __pyx_L1_error)
  }
  __pyx_v_self->_ssymbols = NULL;

  /* "pywrapfst.pyx":4780
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 *     self._acceptor = acceptor
*/
  __pyx_t_2 = (((PyObject *)__pyx_v_ssymbols) != Py_None);
  if (__pyx_t_2) {

    /* "pywrapfst.pyx":4781
 *     self._ssymbols = NULL
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()             # <<<<<<<<<<<<<<
 *     self._acceptor = acceptor
 *     self._keep_isymbols = keep_isymbols
*/
    if (unlikely(((PyObject *)__pyx_v_ssymbols) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_raw_ptr_or_raise");
      __PYX_ERR(0, 4781, __pyx_L1_error)
    }
    __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_SymbolTable *)__pyx_v_ssymbols->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raw_ptr_or_raise(((struct __pyx_obj_9pywrapfst_SymbolTableView *)__pyx_v_ssymbols)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4781, __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, 4781, __pyx_L1_error)
    }
    __pyx_v_self->_ssymbols = __pyx_t_3;

    /* "pywrapfst.pyx":4780
 *       self._osymbols = osymbols._raw_ptr_or_raise()
 *     self._ssymbols = NULL
 *     if ssymbols is not None:             # <<<<<<<<<<<<<<
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 *     self._acceptor = acceptor
*/
  }

  /* "pywrapfst.pyx":4782
 *     if ssymbols is not None:
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 *     self._acceptor = acceptor             # <<<<<<<<<<<<<<
 *     self._keep_isymbols = keep_isymbols
 *     self._keep_osymbols = keep_osymbols
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
    __PYX_ERR(0, 4782, __pyx_L1_error)
  }
  __pyx_v_self->_acceptor = __pyx_v_acceptor;

  /* "pywrapfst.pyx":4783
 *       self._ssymbols = ssymbols._raw_ptr_or_raise()
 *     self._acceptor = acceptor
 *     self._keep_isymbols = keep_isymbols             # <<<<<<<<<<<<<<
 *     self._keep_osymbols = keep_osymbols
 *     self._keep_state_numbering = keep_state_numbering
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
    __PYX_ERR(0, 4783, __pyx_L1_error)
  }
  __pyx_v_self->_keep_isymbols = __pyx_v_keep_isymbols;

  /* "pywrapfst.pyx":4784
 *     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_osymbols");
    __PYX_ERR(0, 4784, __pyx_L1_error)
  }
  __pyx_v_self->_keep_osymbols = __pyx_v_keep_osymbols;

  /* "pywrapfst.pyx":4785
 *     self._keep_isymbols = keep_isymbols
 *     self._keep_osymbols = keep_osymbols
 *     self._keep_state_numbering = keep_state_numbering             # <<<<<<<<<<<<<<
 * 
 *   cpdef Fst compile(self):
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
    __PYX_ERR(0, 4785, __pyx_L1_error)
  }
  __pyx_v_self->_keep_state_numbering = __pyx_v_keep_state_numbering;

  /* "pywrapfst.pyx":4760
 *   """
 * 
 *   def __cinit__(self,             # <<<<<<<<<<<<<<
 *                 str fst_type="vector",
 *                 str arc_type="standard",
*/

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

/* "pywrapfst.pyx":4787
 *     self._keep_state_numbering = keep_state_numbering
 * 
 *   cpdef Fst compile(self):             # <<<<<<<<<<<<<<
 *     """
 *     compile()
*/

static PyObject *__pyx_pw_9pywrapfst_8Compiler_3compile(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compile", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Compiler &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_compile); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_8Compiler_3compile)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4787, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4787, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4802
 *     """
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _tfst = fst.CompileInternal(deref(self._sstrm),
 *                                   b"<pywrapfst>",
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4803
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     with nogil:
 *       _tfst = fst.CompileInternal(deref(self._sstrm),             # <<<<<<<<<<<<<<
 *                                   b"<pywrapfst>",
 *                                   self._fst_type,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4803, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4805
 *       _tfst = fst.CompileInternal(deref(self._sstrm),
 *                                   b"<pywrapfst>",
 *                                   self._fst_type,             # <<<<<<<<<<<<<<
 *                                   self._arc_type,
 *                                   self._isymbols,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst_type");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4805, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4806
 *                                   b"<pywrapfst>",
 *                                   self._fst_type,
 *                                   self._arc_type,             # <<<<<<<<<<<<<<
 *                                   self._isymbols,
 *                                   self._osymbols,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_arc_type");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4806, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4807
 *                                   self._fst_type,
 *                                   self._arc_type,
 *                                   self._isymbols,             # <<<<<<<<<<<<<<
 *                                   self._osymbols,
 *                                   self._ssymbols,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_isymbols");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4807, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4808
 *                                   self._arc_type,
 *                                   self._isymbols,
 *                                   self._osymbols,             # <<<<<<<<<<<<<<
 *                                   self._ssymbols,
 *                                   self._acceptor,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_osymbols");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4808, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4809
 *                                   self._isymbols,
 *                                   self._osymbols,
 *                                   self._ssymbols,             # <<<<<<<<<<<<<<
 *                                   self._acceptor,
 *                                   self._keep_isymbols,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_ssymbols");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4809, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4810
 *                                   self._osymbols,
 *                                   self._ssymbols,
 *                                   self._acceptor,             # <<<<<<<<<<<<<<
 *                                   self._keep_isymbols,
 *                                   self._keep_osymbols,
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_acceptor");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4810, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4811
 *                                   self._ssymbols,
 *                                   self._acceptor,
 *                                   self._keep_isymbols,             # <<<<<<<<<<<<<<
 *                                   self._keep_osymbols,
 *                                   self._keep_state_numbering)
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_isymbols");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4811, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4812
 *                                   self._acceptor,
 *                                   self._keep_isymbols,
 *                                   self._keep_osymbols,             # <<<<<<<<<<<<<<
 *                                   self._keep_state_numbering)
 *     self._sstrm.reset(new stringstream())
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_osymbols");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4812, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4813
 *                                   self._keep_isymbols,
 *                                   self._keep_osymbols,
 *                                   self._keep_state_numbering)             # <<<<<<<<<<<<<<
 *     self._sstrm.reset(new stringstream())
 *     if _tfst.get() == NULL:
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_keep_state_numbering");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4813, __pyx_L4_error)
        }

        /* "pywrapfst.pyx":4803
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     with nogil:
 *       _tfst = fst.CompileInternal(deref(self._sstrm),             # <<<<<<<<<<<<<<
 *                                   b"<pywrapfst>",
 *                                   self._fst_type,
*/
        __pyx_v__tfst = fst::script::CompileInternal((*__pyx_v_self->_sstrm), __pyx_k_pywrapfst, __pyx_v_self->_fst_type, __pyx_v_self->_arc_type, __pyx_v_self->_isymbols, __pyx_v_self->_osymbols, __pyx_v_self->_ssymbols, __pyx_v_self->_acceptor, __pyx_v_self->_keep_isymbols, __pyx_v_self->_keep_osymbols, __pyx_v_self->_keep_state_numbering);
      }

      /* "pywrapfst.pyx":4802
 *     """
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _tfst = fst.CompileInternal(deref(self._sstrm),
 *                                   b"<pywrapfst>",
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4814
 *                                   self._keep_osymbols,
 *                                   self._keep_state_numbering)
 *     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, 4814, __pyx_L1_error)
  }
  __pyx_v_self->_sstrm.reset(new std::stringstream());

  /* "pywrapfst.pyx":4815
 *                                   self._keep_state_numbering)
 *     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);
  if (unlikely(__pyx_t_6)) {

    /* "pywrapfst.pyx":4816
 *     self._sstrm.reset(new stringstream())
 *     if _tfst.get() == NULL:
 *       raise FstOpError("Compilation failed")             # <<<<<<<<<<<<<<
 *     return _init_XFst(_tfst.release())
 * 
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Compilation_failed};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4816, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 4816, __pyx_L1_error)

    /* "pywrapfst.pyx":4815
 *                                   self._keep_state_numbering)
 *     self._sstrm.reset(new stringstream())
 *     if _tfst.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Compilation failed")
 *     return _init_XFst(_tfst.release())
*/
  }

  /* "pywrapfst.pyx":4817
 *     if _tfst.get() == NULL:
 *       raise FstOpError("Compilation failed")
 *     return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 *   cpdef void write(self, expression):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4817, __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":4787
 *     self._keep_state_numbering = keep_state_numbering
 * 
 *   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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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 PyMethodDef __pyx_mdef_9pywrapfst_8Compiler_3compile = {"compile", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_8Compiler_3compile, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_8Compiler_2compile};
static PyObject *__pyx_pw_9pywrapfst_8Compiler_3compile(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("compile (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("compile", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("compile", __pyx_kwds); return NULL;}
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("compile", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_8Compiler_compile(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4787, __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":4819
 *     return _init_XFst(_tfst.release())
 * 
 *   cpdef void write(self, expression):             # <<<<<<<<<<<<<<
 *     """
 *     write(expression)
*/

static PyObject *__pyx_pw_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static void __pyx_f_9pywrapfst_8Compiler_write(struct __pyx_obj_9pywrapfst_Compiler *__pyx_v_self, PyObject *__pyx_v_expression, int __pyx_skip_dispatch) {
  std::string __pyx_v__line;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_Compiler &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_write); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4819, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_8Compiler_5write)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_expression};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4819, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4835
 *       expression: A string expression to add to compiler string buffer.
 *     """
 *     cdef string _line = tostring(expression)             # <<<<<<<<<<<<<<
 *     if not _line.empty() and _line.back() != b'\n':
 *       _line.append(b'\n')
*/
  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_expression); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4835, __pyx_L1_error)
  __pyx_v__line = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pywrapfst.pyx":4836
 *     """
 *     cdef string _line = tostring(expression)
 *     if not _line.empty() and _line.back() != b'\n':             # <<<<<<<<<<<<<<
 *       _line.append(b'\n')
 *     deref(self._sstrm) << _line
*/
  __pyx_t_8 = (!__pyx_v__line.empty());
  if (__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = (__pyx_v__line.back() != '\n');
  __pyx_t_7 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_7) {

    /* "pywrapfst.pyx":4837
 *     cdef string _line = tostring(expression)
 *     if not _line.empty() and _line.back() != b'\n':
 *       _line.append(b'\n')             # <<<<<<<<<<<<<<
 *     deref(self._sstrm) << _line
 * 
*/
    try {
      __pyx_v__line.append(((char const *)"\n"));
    } catch(...) {
      __Pyx_CppExn2PyErr();
      __PYX_ERR(0, 4837, __pyx_L1_error)
    }

    /* "pywrapfst.pyx":4836
 *     """
 *     cdef string _line = tostring(expression)
 *     if not _line.empty() and _line.back() != b'\n':             # <<<<<<<<<<<<<<
 *       _line.append(b'\n')
 *     deref(self._sstrm) << _line
*/
  }

  /* "pywrapfst.pyx":4838
 *     if not _line.empty() and _line.back() != b'\n':
 *       _line.append(b'\n')
 *     deref(self._sstrm) << _line             # <<<<<<<<<<<<<<
 * 
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_sstrm");
    __PYX_ERR(0, 4838, __pyx_L1_error)
  }
  (void)(((*__pyx_v_self->_sstrm) << __pyx_v__line));

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_8Compiler_4write, "\n    write(expression)\n\n    Writes a string into the compiler string buffer.\n\n    This method adds a line to the compiler string buffer. It is normally\n    invoked using the right shift operator, like so:\n\n        compiler = fst.Compiler()\n        compiler.write(\"0 0 49 49\")\n        compiler.write(\"0\")\n\n    Args:\n      expression: A string expression to add to compiler string buffer.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_8Compiler_5write = {"write", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_8Compiler_5write, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_8Compiler_4write};
static PyObject *__pyx_pw_9pywrapfst_8Compiler_5write(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_expression = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("write (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_expression,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4819, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4819, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "write", 0) < 0) __PYX_ERR(0, 4819, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, i); __PYX_ERR(0, 4819, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4819, __pyx_L3_error)
    }
    __pyx_v_expression = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("write", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4819, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Compiler.write", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_8Compiler_4write(((struct __pyx_obj_9pywrapfst_Compiler *)__pyx_v_self), __pyx_v_expression);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("write", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_8Compiler_write(__pyx_v_self, __pyx_v_expression, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4819, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4819, __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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_8Compiler_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_8Compiler_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_8Compiler_7__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 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_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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_8Compiler_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_8Compiler_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_8Compiler_9__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.Compiler.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_8Compiler_8__setstate_cython__(((struct __pyx_obj_9pywrapfst_Compiler *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_no_default___reduce___due_to_non, 0, 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_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":4860
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {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) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); 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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":4861
 * 
 *   def __init__(self):
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_t_3 = __pyx_builtin_NotImplementedError; 
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Cannot_construct, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4861, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 4861, __pyx_L1_error)

  /* "pywrapfst.pyx":4860
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
*/

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

/* "pywrapfst.pyx":4863
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_9FarReader_3__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":4864
 * 
 *   def __repr__(self):
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "far_type");
    __PYX_ERR(0, 4864, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4864, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_5[1] = __pyx_t_2;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_FarReader_at_0x;
  __pyx_t_5[3] = __pyx_t_4;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 16 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4863
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":4866
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def open(cls, *sources):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_5open(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_9FarReader_4open, "\n    FarReader.open(*sources)\n\n    Creates a FarReader object.\n\n    This class method creates a FarReader given the string location of one or\n    more FAR files on disk.\n\n    Args:\n      *sources: The string location of one or more input FAR files.\n\n    Returns:\n      A new FarReader instance.\n\n    Raises:\n      FstIOError: Read failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_5open = {"open", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_9FarReader_5open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_4open};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_5open(PyObject *__pyx_v_cls, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sources = 0;
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("open (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("open", __pyx_kwds); return NULL;}
  __Pyx_INCREF(__pyx_args);
  __pyx_v_sources = __pyx_args;
  __pyx_r = __pyx_pf_9pywrapfst_9FarReader_4open(((PyTypeObject*)__pyx_v_cls), __pyx_v_sources);

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_4open(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_sources) {
  std::vector<std::string>  __pyx_v__sources;
  std::unique_ptr<fst::script::FarReaderClass>  __pyx_v__tfar;
  struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_reader = 0;
  PyObject *__pyx_8genexpr1__pyx_v_source = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  std::string __pyx_t_5;
  std::vector<std::string>  __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  size_t __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("open", 0);

  /* "pywrapfst.pyx":4885
 *       FstIOError: Read failed.
 *     """
 *     cdef vector[string] _sources = [path_tostring(source) for source in sources]             # <<<<<<<<<<<<<<
 *     cdef unique_ptr[fst.FarReaderClass] _tfar
 *     with nogil:
*/
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4885, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_v_sources; __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = 0;
    for (;;) {
      {
        Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 4885, __pyx_L5_error)
        #endif
        if (__pyx_t_3 >= __pyx_temp) break;
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_4 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3));
      #else
      __pyx_t_4 = __Pyx_PySequence_ITEM(__pyx_t_2, __pyx_t_3);
      #endif
      ++__pyx_t_3;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4885, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_XDECREF_SET(__pyx_8genexpr1__pyx_v_source, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_5 = __pyx_f_9pywrapfst_path_tostring(__pyx_8genexpr1__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4885, __pyx_L5_error)
      __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4885, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 4885, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source); __pyx_8genexpr1__pyx_v_source = 0;
    goto __pyx_L9_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source); __pyx_8genexpr1__pyx_v_source = 0;
    goto __pyx_L1_error;
    __pyx_L9_exit_scope:;
  } /* exit inner scope */
  __pyx_t_6 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4885, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v__sources = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pywrapfst.pyx":4887
 *     cdef vector[string] _sources = [path_tostring(source) for source in sources]
 *     cdef unique_ptr[fst.FarReaderClass] _tfar
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _tfar = fst.FarReaderClass.Open(_sources)
 *     if _tfar.get() == NULL:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4888
 *     cdef unique_ptr[fst.FarReaderClass] _tfar
 *     with nogil:
 *       _tfar = fst.FarReaderClass.Open(_sources)             # <<<<<<<<<<<<<<
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Read failed: {sources!r}")
*/
        __pyx_v__tfar = fst::script::FarReaderClass::Open(__pyx_v__sources);
      }

      /* "pywrapfst.pyx":4887
 *     cdef vector[string] _sources = [path_tostring(source) for source in sources]
 *     cdef unique_ptr[fst.FarReaderClass] _tfar
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _tfar = fst.FarReaderClass.Open(_sources)
 *     if _tfar.get() == NULL:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L12;
        }
        __pyx_L12:;
      }
  }

  /* "pywrapfst.pyx":4889
 *     with nogil:
 *       _tfar = fst.FarReaderClass.Open(_sources)
 *     if _tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {sources!r}")
 *     cdef FarReader reader = FarReader.__new__(FarReader)
*/
  __pyx_t_7 = (__pyx_v__tfar.get() == NULL);
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":4890
 *       _tfar = fst.FarReaderClass.Open(_sources)
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Read failed: {sources!r}")             # <<<<<<<<<<<<<<
 *     cdef FarReader reader = FarReader.__new__(FarReader)
 *     reader._reader = move(_tfar)
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_sources), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Read_failed, __pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 4890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_10 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_10 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_9};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (__pyx_t_10*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 4890, __pyx_L1_error)

    /* "pywrapfst.pyx":4889
 *     with nogil:
 *       _tfar = fst.FarReaderClass.Open(_sources)
 *     if _tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Read failed: {sources!r}")
 *     cdef FarReader reader = FarReader.__new__(FarReader)
*/
  }

  /* "pywrapfst.pyx":4891
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Read failed: {sources!r}")
 *     cdef FarReader reader = FarReader.__new__(FarReader)             # <<<<<<<<<<<<<<
 *     reader._reader = move(_tfar)
 *     return reader
*/
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarReader(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4891, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_reader = ((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "pywrapfst.pyx":4892
 *       raise FstIOError(f"Read failed: {sources!r}")
 *     cdef FarReader reader = FarReader.__new__(FarReader)
 *     reader._reader = move(_tfar)             # <<<<<<<<<<<<<<
 *     return reader
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_reader) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4892, __pyx_L1_error)
  }
  __pyx_v_reader->_reader = cython_std::move<std::unique_ptr<fst::script::FarReaderClass> >(__pyx_v__tfar);

  /* "pywrapfst.pyx":4893
 *     cdef FarReader reader = FarReader.__new__(FarReader)
 *     reader._reader = move(_tfar)
 *     return reader             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_reader);
  __pyx_r = ((PyObject *)__pyx_v_reader);
  goto __pyx_L0;

  /* "pywrapfst.pyx":4866
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def open(cls, *sources):
 *     """
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pywrapfst.FarReader.open", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_reader);
  __Pyx_XDECREF(__pyx_8genexpr1__pyx_v_source);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4895
 *     return reader
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_7arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4895, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_7arc_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4895, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4895, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4901
 *     Returns a string indicating the arc type.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._reader.get().ArcType()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4902
 *     """
 *     with nogil:
 *       return self._reader.get().ArcType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool done(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4902, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_reader.get()->ArcType();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":4901
 *     Returns a string indicating the arc type.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._reader.get().ArcType()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":4895
 *     return reader
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_7arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_9FarReader_6arc_type, "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_7arc_type = {"arc_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_7arc_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_6arc_type};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_7arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("arc_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("arc_type", __pyx_kwds); return NULL;}
  __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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_arc_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4895, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4895, __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.arc_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4904
 *       return self._reader.get().ArcType()
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_done); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4904, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_9done)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4904, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4904, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4913
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._reader.get().Done()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4914
 *     """
 *     with nogil:
 *       return self._reader.get().Done()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool error(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4914, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_reader.get()->Done();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":4913
 *       True if the iterator is exhausted, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._reader.get().Done()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":4904
 *       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_AddTraceback("pywrapfst.FarReader.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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 PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_9done = {"done", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_9done, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_8done};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_9done(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("done (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("done", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("done", __pyx_kwds); return NULL;}
  __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
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("done", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_done(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4904, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4904, __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.done", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4916
 *       return self._reader.get().Done()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_11error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_11error)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4916, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4916, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

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

  /* "pywrapfst.pyx":4916
 *       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_AddTraceback("pywrapfst.FarReader.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_11error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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 PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_11error = {"error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_11error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_10error};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_11error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("error", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("error", __pyx_kwds); return NULL;}
  __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
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_error(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4916, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4916, __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.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4927
 *     return self._reader.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       return fst.GetFarTypeString(self._reader.get().Type())
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_13far_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("far_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4927, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_13far_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4927, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4927, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4928
 * 
 *   cpdef string far_type(self):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return fst.GetFarTypeString(self._reader.get().Type())
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4929
 *   cpdef string far_type(self):
 *     with nogil:
 *       return fst.GetFarTypeString(self._reader.get().Type())             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool find(self, key):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4929, __pyx_L4_error)
        }
        __pyx_r = fst::GetFarTypeString(__pyx_v_self->_reader.get()->Type());
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":4928
 * 
 *   cpdef string far_type(self):
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return fst.GetFarTypeString(self._reader.get().Type())
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":4927
 *     return self._reader.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       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_AddTraceback("pywrapfst.FarReader.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_13far_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_13far_type = {"far_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_13far_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_13far_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("far_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("far_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("far_type", __pyx_kwds); return NULL;}
  __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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("far_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_far_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4927, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4927, __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.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4931
 *       return fst.GetFarTypeString(self._reader.get().Type())
 * 
 *   cpdef bool find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_15find(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static bool __pyx_f_9pywrapfst_9FarReader_find(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::string __pyx_v__key;
  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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  std::string __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("find", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_find); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_15find)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4931, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 4931, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4944
 *       True if the key was found, False otherwise.
 *     """
 *     cdef string _key = tostring(key)             # <<<<<<<<<<<<<<
 *     with nogil:
 *       return self._reader.get().Find(_key)
*/
  __pyx_t_7 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4944, __pyx_L1_error)
  __pyx_v__key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_7);

  /* "pywrapfst.pyx":4945
 *     """
 *     cdef string _key = tostring(key)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._reader.get().Find(_key)
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4946
 *     cdef string _key = tostring(key)
 *     with nogil:
 *       return self._reader.get().Find(_key)             # <<<<<<<<<<<<<<
 * 
 *   cpdef Fst get_fst(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4946, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_reader.get()->Find(__pyx_v__key);
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":4945
 *     """
 *     cdef string _key = tostring(key)
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._reader.get().Find(_key)
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":4931
 *       return fst.GetFarTypeString(self._reader.get().Type())
 * 
 *   cpdef bool find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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 PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_15find = {"find", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_15find, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_14find};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_15find(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("find (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 4931, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4931, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "find", 0) < 0) __PYX_ERR(0, 4931, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("find", 1, 1, 1, i); __PYX_ERR(0, 4931, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 4931, __pyx_L3_error)
    }
    __pyx_v_key = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("find", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 4931, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.FarReader.find", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_9FarReader_14find(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self), __pyx_v_key);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("find", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_find(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4931, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4931, __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":4948
 *       return self._reader.get().Find(_key)
 * 
 *   cpdef Fst get_fst(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_fst(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_17get_fst(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static struct __pyx_obj_9pywrapfst_Fst *__pyx_f_9pywrapfst_9FarReader_get_fst(struct __pyx_obj_9pywrapfst_FarReader *__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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fst", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_get_fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4948, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_17get_fst)) {
        __Pyx_XDECREF((PyObject *)__pyx_r);
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4948, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst))))) __PYX_ERR(0, 4948, __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;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4958
 *     """
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _tfst.reset(new fst.FstClass(deref(self._reader.get().GetFstClass())))
 *     return _init_XFst(_tfst.release())
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4959
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     with nogil:
 *       _tfst.reset(new fst.FstClass(deref(self._reader.get().GetFstClass())))             # <<<<<<<<<<<<<<
 *     return _init_XFst(_tfst.release())
 * 
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4959, __pyx_L4_error)
        }
        __pyx_v__tfst.reset(new fst::script::FstClass((*__pyx_v_self->_reader.get()->GetFstClass())));
      }

      /* "pywrapfst.pyx":4958
 *     """
 *     cdef unique_ptr[fst.FstClass] _tfst
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _tfst.reset(new fst.FstClass(deref(self._reader.get().GetFstClass())))
 *     return _init_XFst(_tfst.release())
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":4960
 *     with nogil:
 *       _tfst.reset(new fst.FstClass(deref(self._reader.get().GetFstClass())))
 *     return _init_XFst(_tfst.release())             # <<<<<<<<<<<<<<
 * 
 *   cpdef string get_key(self):
*/
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst__init_XFst(__pyx_v__tfst.release())); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4960, __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":4948
 *       return self._reader.get().Find(_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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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 PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_17get_fst = {"get_fst", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_17get_fst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_16get_fst};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_17get_fst(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_fst (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_fst", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_fst", __pyx_kwds); return NULL;}
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_fst", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9pywrapfst_9FarReader_get_fst(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4948, __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":4962
 *     return _init_XFst(_tfst.release())
 * 
 *   cpdef string get_key(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_key(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_19get_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_key", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_get_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_19get_key)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4962, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4962, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4971
 *       The string key at the current position.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._reader.get().GetKey()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4972
 *     """
 *     with nogil:
 *       return self._reader.get().GetKey()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void next(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4972, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_reader.get()->GetKey();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":4971
 *       The string key at the current position.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._reader.get().GetKey()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":4962
 *     return _init_XFst(_tfst.release())
 * 
 *   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_AddTraceback("pywrapfst.FarReader.get_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_19get_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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 PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_19get_key = {"get_key", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_19get_key, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_18get_key};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_19get_key(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_key (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("get_key", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("get_key", __pyx_kwds); return NULL;}
  __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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_key", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarReader_get_key(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4962, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4962, __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.get_key", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":4974
 *       return self._reader.get().GetKey()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_21next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_next); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4974, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_21next)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4974, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4980
 *     Advances the iterator.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._reader.get().Next()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":4981
 *     """
 *     with nogil:
 *       self._reader.get().Next()             # <<<<<<<<<<<<<<
 * 
 *   cpdef void reset(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 4981, __pyx_L4_error)
        }
        __pyx_v_self->_reader.get()->Next();
      }

      /* "pywrapfst.pyx":4980
 *     Advances the iterator.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       self._reader.get().Next()
 * 
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_21next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_9FarReader_20next, "\n    next(self)\n\n    Advances the iterator.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_21next = {"next", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_21next, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_20next};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_21next(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("next (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("next", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("next", __pyx_kwds); return NULL;}
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("next", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_9FarReader_next(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4974, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4974, __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":4983
 *       self._reader.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarReader_23reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
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;
  size_t __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_reset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4983, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarReader_23reset)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4983, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":4989
 *     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, 4989, __pyx_L1_error)
  }
  __pyx_v_self->_reader.get()->Reset();

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_23reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_9FarReader_22reset, "\n    reset(self)\n\n    Resets the iterator to the initial position.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_23reset = {"reset", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_23reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_22reset};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_23reset(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("reset", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("reset", __pyx_kwds); return NULL;}
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("reset", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_9pywrapfst_9FarReader_reset(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4983, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4983, __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":4991
 *     self._reader.get().Reset()
 * 
 *   def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *     if self._reader.get().Find(tostring(key)):
 *       return self.get_fst()
*/

/* Python wrapper */
static PyObject *__pyx_pw_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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_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) {
  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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "pywrapfst.pyx":4992
 * 
 *   def __getitem__(self, key):
 *     if self._reader.get().Find(tostring(key)):             # <<<<<<<<<<<<<<
 *       return self.get_fst()
 *     else:
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_reader");
    __PYX_ERR(0, 4992, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4992, __pyx_L1_error)
  __pyx_t_2 = (__pyx_v_self->_reader.get()->Find(__pyx_t_1) != 0);
  if (likely(__pyx_t_2)) {

    /* "pywrapfst.pyx":4993
 *   def __getitem__(self, key):
 *     if self._reader.get().Find(tostring(key)):
 *       return self.get_fst()             # <<<<<<<<<<<<<<
 *     else:
 *       raise KeyError(key)
*/
    __Pyx_XDECREF(__pyx_r);
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_fst");
      __PYX_ERR(0, 4993, __pyx_L1_error)
    }
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_fst(__pyx_v_self, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4993, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "pywrapfst.pyx":4992
 * 
 *   def __getitem__(self, key):
 *     if self._reader.get().Find(tostring(key)):             # <<<<<<<<<<<<<<
 *       return self.get_fst()
 *     else:
*/
  }

  /* "pywrapfst.pyx":4995
 *       return self.get_fst()
 *     else:
 *       raise KeyError(key)             # <<<<<<<<<<<<<<
 * 
 *   def __next__(self):
*/
  /*else*/ {
    __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_builtin_KeyError);
    __pyx_t_5 = __pyx_builtin_KeyError; 
    __pyx_t_6 = 1;
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_key};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4995, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 4995, __pyx_L1_error)
  }

  /* "pywrapfst.pyx":4991
 *     self._reader.get().Reset()
 * 
 *   def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *     if self._reader.get().Find(tostring(key)):
 *       return self.get_fst()
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_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;
}

/* "pywrapfst.pyx":4997
 *       raise KeyError(key)
 * 
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_27__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_9FarReader_27__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __pyx_r = __pyx_pf_9pywrapfst_9FarReader_26__next__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_26__next__(struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  std::string __pyx_v__key;
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v__fst = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_error_without_exception = 0; /* StopIteration */
  bool __pyx_t_1;
  int __pyx_t_2;
  std::string __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "pywrapfst.pyx":4998
 * 
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef string _key = self.get_key()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "done");
    __PYX_ERR(0, 4998, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->done(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 4998, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "pywrapfst.pyx":4999
 *   def __next__(self):
 *     if self.done():
 *       raise StopIteration             # <<<<<<<<<<<<<<
 *     cdef string _key = self.get_key()
 *     cdef Fst _fst = self.get_fst()
*/
    __pyx_error_without_exception = 1;
    goto __pyx_L1_error;;

    /* "pywrapfst.pyx":4998
 * 
 *   def __next__(self):
 *     if self.done():             # <<<<<<<<<<<<<<
 *       raise StopIteration
 *     cdef string _key = self.get_key()
*/
  }

  /* "pywrapfst.pyx":5000
 *     if self.done():
 *       raise StopIteration
 *     cdef string _key = self.get_key()             # <<<<<<<<<<<<<<
 *     cdef Fst _fst = self.get_fst()
 *     self.next()
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_key");
    __PYX_ERR(0, 5000, __pyx_L1_error)
  }
  __pyx_t_3 = ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->get_key(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5000, __pyx_L1_error)
  __pyx_v__key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_3);

  /* "pywrapfst.pyx":5001
 *       raise StopIteration
 *     cdef string _key = self.get_key()
 *     cdef Fst _fst = self.get_fst()             # <<<<<<<<<<<<<<
 *     self.next()
 *     return _key, _fst
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get_fst");
    __PYX_ERR(0, 5001, __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, 5001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v__fst = ((struct __pyx_obj_9pywrapfst_Fst *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pywrapfst.pyx":5002
 *     cdef string _key = self.get_key()
 *     cdef Fst _fst = self.get_fst()
 *     self.next()             # <<<<<<<<<<<<<<
 *     return _key, _fst
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "next");
    __PYX_ERR(0, 5002, __pyx_L1_error)
  }
  ((struct __pyx_vtabstruct_9pywrapfst_FarReader *)__pyx_v_self->__pyx_vtab)->next(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5002, __pyx_L1_error)

  /* "pywrapfst.pyx":5003
 *     cdef Fst _fst = self.get_fst()
 *     self.next()
 *     return _key, _fst             # <<<<<<<<<<<<<<
 * 
 *   # This just registers this class as a possible iterator.
*/
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_v__key); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4) != (0)) __PYX_ERR(0, 5003, __pyx_L1_error);
  __Pyx_INCREF((PyObject *)__pyx_v__fst);
  __Pyx_GIVEREF((PyObject *)__pyx_v__fst);
  if (__Pyx_PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v__fst)) != (0)) __PYX_ERR(0, 5003, __pyx_L1_error);
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":4997
 *       raise KeyError(key)
 * 
 *   def __next__(self):             # <<<<<<<<<<<<<<
 *     if self.done():
 *       raise StopIteration
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  if (!__pyx_error_without_exception) {
    __Pyx_AddTraceback("pywrapfst.FarReader.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  }
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v__fst);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

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

  /* "pywrapfst.pyx":5007
 *   # This just registers this class as a possible iterator.
 *   def __iter__(self):
 *     return self             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

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

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

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarReader_31__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_31__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_31__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __pyx_r = __pyx_pf_9pywrapfst_9FarReader_30__reduce_cython__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self));

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_30__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9pywrapfst_FarReader *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 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_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__reader_cannot_be_converted, 0, 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_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_33__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_9FarReader_33__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_9FarReader_33__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.FarReader.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_9FarReader_32__setstate_cython__(((struct __pyx_obj_9pywrapfst_FarReader *)__pyx_v_self), __pyx_v___pyx_state);

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

static PyObject *__pyx_pf_9pywrapfst_9FarReader_32__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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._reader cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._reader cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__reader_cannot_be_converted, 0, 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_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":5030
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {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) {
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
  #endif
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return -1;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); 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;
  size_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "pywrapfst.pyx":5031
 * 
 *   def __init__(self):
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")             # <<<<<<<<<<<<<<
 * 
 *   def __repr__(self):
*/
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_NotImplementedError);
  __pyx_t_3 = __pyx_builtin_NotImplementedError; 
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_FormatSimple(__pyx_t_5, __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Cannot_construct, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_6, (2-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  }
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(0, 5031, __pyx_L1_error)

  /* "pywrapfst.pyx":5030
 *   """
 * 
 *   def __init__(self):             # <<<<<<<<<<<<<<
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
*/

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

/* "pywrapfst.pyx":5033
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_3__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_3__repr__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  __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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "pywrapfst.pyx":5034
 * 
 *   def __repr__(self):
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"             # <<<<<<<<<<<<<<
 * 
 *   @classmethod
*/
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "far_type");
    __PYX_ERR(0, 5034, __pyx_L1_error)
  }
  __pyx_t_1 = ((struct __pyx_vtabstruct_9pywrapfst_FarWriter *)__pyx_v_self->__pyx_vtab)->far_type(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5034, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_Format(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5[0] = __pyx_mstate_global->__pyx_kp_u__2;
  __pyx_t_5[1] = __pyx_t_2;
  __pyx_t_5[2] = __pyx_mstate_global->__pyx_kp_u_FarWriter_at_0x;
  __pyx_t_5[3] = __pyx_t_4;
  __pyx_t_5[4] = __pyx_mstate_global->__pyx_kp_u__3;
  __pyx_t_3 = __Pyx_PyUnicode_Join(__pyx_t_5, 5, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 16 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_4), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_4));
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5034, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "pywrapfst.pyx":5033
 *     raise NotImplementedError(f"Cannot construct {self.__class__.__name__}")
 * 
 *   def __repr__(self):             # <<<<<<<<<<<<<<
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
*/

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __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":5036
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def create(cls, source, arc_type="standard", far_type="default"):
 *     """
*/

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_5create(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_9FarWriter_4create, "\n    FarWriter.\n\n    Creates a FarWriter object.\n\n    This class method creates a FarWriter given the desired output location,\n    arc type, and FAR type.\n\n    Args:\n      source: The string location for the output FAR files.\n      arc_type: A string indicating the arc type.\n      far_type: A string indicating the FAR type; one of:\n        * \"fst\"\n        * \"stlist\",\n        * \"sttable\"\n        * \"sstable\"  # copybara:strip(SSTable not released)\n        * \"default\".\n\n    Returns:\n      A new FarWriter instance.\n\n    Raises:\n      FstIOError: Read failed.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_9FarWriter_5create = {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarWriter_4create};
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_5create(PyObject *__pyx_v_cls, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_arc_type = 0;
  PyObject *__pyx_v_far_type = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[3] = {0,0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,&__pyx_mstate_global->__pyx_n_u_arc_type,&__pyx_mstate_global->__pyx_n_u_far_type,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5036, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "create", 0) < 0) __PYX_ERR(0, 5036, __pyx_L3_error)
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_standard));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_default));
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, i); __PYX_ERR(0, 5036, __pyx_L3_error) }
      }
    } else {
      switch (__pyx_nargs) {
        case  3:
        values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 5036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5036, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5036, __pyx_L3_error)
        break;
        default: goto __pyx_L5_argtuple_error;
      }
      if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_standard));
      if (!values[2]) values[2] = __Pyx_NewRef(((PyObject *)__pyx_mstate_global->__pyx_n_u_default));
    }
    __pyx_v_source = values[0];
    __pyx_v_arc_type = values[1];
    __pyx_v_far_type = values[2];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create", 0, 1, 3, __pyx_nargs); __PYX_ERR(0, 5036, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_source, __pyx_v_arc_type, __pyx_v_far_type);

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

static PyObject *__pyx_pf_9pywrapfst_9FarWriter_4create(CYTHON_UNUSED PyTypeObject *__pyx_v_cls, PyObject *__pyx_v_source, PyObject *__pyx_v_arc_type, PyObject *__pyx_v_far_type) {
  std::unique_ptr<fst::script::FarWriterClass>  __pyx_v__tfar;
  std::string __pyx_v__source;
  std::string __pyx_v__arc_type;
  fst::FarType __pyx_v__far_type;
  struct __pyx_obj_9pywrapfst_FarWriter *__pyx_v_writer = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::string __pyx_t_1;
  fst::FarType __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;
  size_t __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create", 0);

  /* "pywrapfst.pyx":5063
 *     """
 *     cdef unique_ptr[fst.FarWriterClass] _tfar
 *     cdef string _source = path_tostring(source)             # <<<<<<<<<<<<<<
 *     cdef string _arc_type = tostring(arc_type)
 *     cdef fst.FarType _far_type = _get_far_type(tostring(far_type))
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_path_tostring(__pyx_v_source); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5063, __pyx_L1_error)
  __pyx_v__source = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":5064
 *     cdef unique_ptr[fst.FarWriterClass] _tfar
 *     cdef string _source = path_tostring(source)
 *     cdef string _arc_type = tostring(arc_type)             # <<<<<<<<<<<<<<
 *     cdef fst.FarType _far_type = _get_far_type(tostring(far_type))
 *     with nogil:
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_arc_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5064, __pyx_L1_error)
  __pyx_v__arc_type = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_1);

  /* "pywrapfst.pyx":5065
 *     cdef string _source = path_tostring(source)
 *     cdef string _arc_type = tostring(arc_type)
 *     cdef fst.FarType _far_type = _get_far_type(tostring(far_type))             # <<<<<<<<<<<<<<
 *     with nogil:
 *       _tfar = fst.FarWriterClass.Create(_source,
*/
  __pyx_t_1 = __pyx_f_9pywrapfst_tostring(__pyx_v_far_type); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5065, __pyx_L1_error)
  __pyx_t_2 = __pyx_f_9pywrapfst__get_far_type(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5065, __pyx_L1_error)
  __pyx_v__far_type = __pyx_t_2;

  /* "pywrapfst.pyx":5066
 *     cdef string _arc_type = tostring(arc_type)
 *     cdef fst.FarType _far_type = _get_far_type(tostring(far_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _tfar = fst.FarWriterClass.Create(_source,
 *                                         _arc_type,
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":5067
 *     cdef fst.FarType _far_type = _get_far_type(tostring(far_type))
 *     with nogil:
 *       _tfar = fst.FarWriterClass.Create(_source,             # <<<<<<<<<<<<<<
 *                                         _arc_type,
 *                                         _far_type)
*/
        __pyx_v__tfar = fst::script::FarWriterClass::Create(__pyx_v__source, __pyx_v__arc_type, __pyx_v__far_type);
      }

      /* "pywrapfst.pyx":5066
 *     cdef string _arc_type = tostring(arc_type)
 *     cdef fst.FarType _far_type = _get_far_type(tostring(far_type))
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _tfar = fst.FarWriterClass.Create(_source,
 *                                         _arc_type,
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":5070
 *                                         _arc_type,
 *                                         _far_type)
 *     if _tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Open failed: {source!r}")
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
*/
  __pyx_t_3 = (__pyx_v__tfar.get() == NULL);
  if (unlikely(__pyx_t_3)) {

    /* "pywrapfst.pyx":5071
 *                                         _far_type)
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Open failed: {source!r}")             # <<<<<<<<<<<<<<
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
 *     writer._writer = move(_tfar)
*/
    __pyx_t_5 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_FstIOError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 5071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_source), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Open_failed, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 5071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_9 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
      assert(__pyx_t_5);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
      __pyx_t_9 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_8};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5071, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 5071, __pyx_L1_error)

    /* "pywrapfst.pyx":5070
 *                                         _arc_type,
 *                                         _far_type)
 *     if _tfar.get() == NULL:             # <<<<<<<<<<<<<<
 *       raise FstIOError(f"Open failed: {source!r}")
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
*/
  }

  /* "pywrapfst.pyx":5072
 *     if _tfar.get() == NULL:
 *       raise FstIOError(f"Open failed: {source!r}")
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)             # <<<<<<<<<<<<<<
 *     writer._writer = move(_tfar)
 *     return writer
*/
  __pyx_t_4 = ((PyObject *)__pyx_tp_new_9pywrapfst_FarWriter(((PyTypeObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter), __pyx_mstate_global->__pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5072, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_4);
  __pyx_v_writer = ((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "pywrapfst.pyx":5073
 *       raise FstIOError(f"Open failed: {source!r}")
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
 *     writer._writer = move(_tfar)             # <<<<<<<<<<<<<<
 *     return writer
 * 
*/
  if (unlikely(((PyObject *)__pyx_v_writer) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
    __PYX_ERR(0, 5073, __pyx_L1_error)
  }
  __pyx_v_writer->_writer = cython_std::move<std::unique_ptr<fst::script::FarWriterClass> >(__pyx_v__tfar);

  /* "pywrapfst.pyx":5074
 *     cdef FarWriter writer = FarWriter.__new__(FarWriter)
 *     writer._writer = move(_tfar)
 *     return writer             # <<<<<<<<<<<<<<
 * 
 *   # NB: Invoking this method may be dangerous: calling any other method on the
*/
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_writer);
  __pyx_r = ((PyObject *)__pyx_v_writer);
  goto __pyx_L0;

  /* "pywrapfst.pyx":5036
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def create(cls, source, arc_type="standard", far_type="default"):
 *     """
*/

  /* 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.FarWriter.create", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_writer);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":5078
 *   # 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) {
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":5079
 *   # 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, 5079, __pyx_L1_error)
  }
  __pyx_v_self->_writer.reset();

  /* "pywrapfst.pyx":5078
 *   # 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_AddTraceback("pywrapfst.FarWriter.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
}

/* "pywrapfst.pyx":5081
 *     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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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) {
  std::string __pyx_v__key;
  bool __pyx_v__result;
  __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;
  std::string __pyx_t_6;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarWriter_7add)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_v_key, ((PyObject *)__pyx_v_ifst)};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5081, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":5099
 *     # Failure here results from passing an FST with a different arc type than
 *     # used by the FAR was initialized to use.
 *     cdef string _key = tostring(key)             # <<<<<<<<<<<<<<
 *     cdef bool _result
 *     with nogil:
*/
  __pyx_t_6 = __pyx_f_9pywrapfst_tostring(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5099, __pyx_L1_error)
  __pyx_v__key = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_6);

  /* "pywrapfst.pyx":5101
 *     cdef string _key = tostring(key)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._writer.get().Add(_key, deref(ifst._fst))
 *     if not _result:
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":5102
 *     cdef bool _result
 *     with nogil:
 *       _result = self._writer.get().Add(_key, deref(ifst._fst))             # <<<<<<<<<<<<<<
 *     if not _result:
 *       raise FstOpError("Incompatible or invalid arc type")
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 5102, __pyx_L4_error)
        }
        if (unlikely(((PyObject *)__pyx_v_ifst) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_fst");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 5102, __pyx_L4_error)
        }
        __pyx_v__result = __pyx_v_self->_writer.get()->Add(__pyx_v__key, (*__pyx_v_ifst->_fst));
      }

      /* "pywrapfst.pyx":5101
 *     cdef string _key = tostring(key)
 *     cdef bool _result
 *     with nogil:             # <<<<<<<<<<<<<<
 *       _result = self._writer.get().Add(_key, deref(ifst._fst))
 *     if not _result:
*/
      /*finally:*/ {
        /*normal exit:*/{
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L5;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }
  }

  /* "pywrapfst.pyx":5103
 *     with nogil:
 *       _result = self._writer.get().Add(_key, deref(ifst._fst))
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
*/
  __pyx_t_7 = (!(__pyx_v__result != 0));
  if (unlikely(__pyx_t_7)) {

    /* "pywrapfst.pyx":5104
 *       _result = self._writer.get().Add(_key, deref(ifst._fst))
 *     if not _result:
 *       raise FstOpError("Incompatible or invalid arc type")             # <<<<<<<<<<<<<<
 * 
 *   cpdef string arc_type(self):
*/
    __pyx_t_2 = NULL;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_FstOpError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = 1;
    #if CYTHON_UNPACK_METHODS
    if (unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      assert(__pyx_t_2);
      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(__pyx__function);
      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
      __pyx_t_5 = 0;
    }
    #endif
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_Incompatible_or_invalid_arc_type};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(0, 5104, __pyx_L1_error)

    /* "pywrapfst.pyx":5103
 *     with nogil:
 *       _result = self._writer.get().Add(_key, deref(ifst._fst))
 *     if not _result:             # <<<<<<<<<<<<<<
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
*/
  }

  /* "pywrapfst.pyx":5081
 *     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_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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_9FarWriter_6add, "\n    add(self, key, ifst)\n\n    Adds an FST to the FAR.\n\n    This method adds an FST to the FAR which can be retrieved with the\n    specified string key.\n\n    Args:\n      key: The string used to key the input FST.\n      ifst: The FST to write to the FAR.\n\n    Raises:\n      FstOpError: Incompatible or invalid arc type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_9FarWriter_7add = {"add", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_7add, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarWriter_6add};
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_7add(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_9pywrapfst_Fst *__pyx_v_ifst = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[2] = {0,0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_key,&__pyx_mstate_global->__pyx_n_u_ifst,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 5081, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  2:
        values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5081, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "add", 0) < 0) __PYX_ERR(0, 5081, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, i); __PYX_ERR(0, 5081, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 5081, __pyx_L3_error)
      values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 5081, __pyx_L3_error)
    }
    __pyx_v_key = values[0];
    __pyx_v_ifst = ((struct __pyx_obj_9pywrapfst_Fst *)values[1]);
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 5081, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "ifst", 0))) __PYX_ERR(0, 5081, __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;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  goto __pyx_L7_cleaned_up;
  __pyx_L0:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __pyx_L7_cleaned_up:;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __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, 5081, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5081, __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":5106
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarWriter_9arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_arc_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarWriter_9arc_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5106, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5106, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":5112
 *     Returns a string indicating the arc type.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._writer.get().ArcType()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":5113
 *     """
 *     with nogil:
 *       return self._writer.get().ArcType()             # <<<<<<<<<<<<<<
 * 
 *   cpdef bool error(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 5113, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_writer.get()->ArcType();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":5112
 *     Returns a string indicating the arc type.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._writer.get().ArcType()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":5106
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/

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

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_9arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_9FarWriter_8arc_type, "\n    arc_type(self)\n\n    Returns a string indicating the arc type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_9FarWriter_9arc_type = {"arc_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_9arc_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarWriter_8arc_type};
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_9arc_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("arc_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("arc_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("arc_type", __pyx_kwds); return NULL;}
  __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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("arc_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarWriter_arc_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5106, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5106, __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.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":5115
 *       return self._writer.get().ArcType()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
*/

static PyObject *__pyx_pw_9pywrapfst_9FarWriter_11error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  bool __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5115, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarWriter_11error)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5115, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 5115, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":5124
 *       True if the FarWriter is in an errorful state, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._writer.get().Error()
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":5125
 *     """
 *     with nogil:
 *       return self._writer.get().Error()             # <<<<<<<<<<<<<<
 * 
 *   cpdef string far_type(self):
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 5125, __pyx_L4_error)
        }
        __pyx_r = __pyx_v_self->_writer.get()->Error();
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":5124
 *       True if the FarWriter is in an errorful state, False otherwise.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return self._writer.get().Error()
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":5115
 *       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_AddTraceback("pywrapfst.FarWriter.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_11error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_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 PyMethodDef __pyx_mdef_9pywrapfst_9FarWriter_11error = {"error", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_11error, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarWriter_10error};
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_11error(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("error (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("error", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("error", __pyx_kwds); return NULL;}
  __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
  bool __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarWriter_error(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5115, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5115, __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.FarWriter.error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "pywrapfst.pyx":5127
 *       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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static 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;
  size_t __pyx_t_5;
  std::string __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("far_type", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (
  #if !CYTHON_USE_TYPE_SLOTS
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter &&
  __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
  #else
  unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
  #endif
  ) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_far_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_9pywrapfst_9FarWriter_13far_type)) {
        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = __pyx_t_1; 
        __pyx_t_5 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_4))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
          __pyx_t_5 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5127, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_convert_string_from_py_6libcpp_6string_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5127, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_6;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "pywrapfst.pyx":5133
 *     Returns a string indicating the FAR type.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return fst.GetFarTypeString(self._writer.get().Type())
 * 
*/
  {
      PyThreadState *_save;
      _save = NULL;
      Py_UNBLOCK_THREADS
      __Pyx_FastGIL_Remember();
      /*try:*/ {

        /* "pywrapfst.pyx":5134
 *     """
 *     with nogil:
 *       return fst.GetFarTypeString(self._writer.get().Type())             # <<<<<<<<<<<<<<
 * 
 *   # Dictionary-like assignment.
*/
        if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
          PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "_writer");
          __Pyx_PyGILState_Release(__pyx_gilstate_save);
          __PYX_ERR(0, 5134, __pyx_L4_error)
        }
        __pyx_r = fst::GetFarTypeString(__pyx_v_self->_writer.get()->Type());
        goto __pyx_L3_return;
      }

      /* "pywrapfst.pyx":5133
 *     Returns a string indicating the FAR type.
 *     """
 *     with nogil:             # <<<<<<<<<<<<<<
 *       return fst.GetFarTypeString(self._writer.get().Type())
 * 
*/
      /*finally:*/ {
        __pyx_L3_return: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L0;
        }
        __pyx_L4_error: {
          __Pyx_FastGIL_Forget();
          Py_BLOCK_THREADS
          goto __pyx_L1_error;
        }
      }
  }

  /* "pywrapfst.pyx":5127
 *       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_AddTraceback("pywrapfst.FarWriter.far_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_13far_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9pywrapfst_9FarWriter_12far_type, "\n    far_type(self)\n\n    Returns a string indicating the FAR type.\n    ");
static PyMethodDef __pyx_mdef_9pywrapfst_9FarWriter_13far_type = {"far_type", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_13far_type, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarWriter_12far_type};
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_13far_type(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("far_type (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("far_type", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("far_type", __pyx_kwds); return NULL;}
  __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
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("far_type", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_9pywrapfst_9FarWriter_far_type(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 5127, __pyx_L1_error)
  __pyx_t_2 = __pyx_convert_PyUnicode_string_to_py_6libcpp_6string_std__in_string(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5127, __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.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":5137
 * 
 *   # 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) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fst), __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, 1, "fst", 0))) __PYX_ERR(0, 5137, __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;
  goto __pyx_L5_cleaned_up;
  __pyx_L0:;
  __pyx_L5_cleaned_up:;
  __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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;

  /* "pywrapfst.pyx":5138
 *   # 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, 5138, __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, 5138, __pyx_L1_error)

  /* "pywrapfst.pyx":5137
 * 
 *   # 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:;
  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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_9FarWriter_17__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_17__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL; }
  const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  if (unlikely(__pyx_kwds_len < 0)) return NULL;
  if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__reduce_cython__", __pyx_kwds); return NULL;}
  __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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._writer cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._writer cannot be converted to a Python object for pickling"
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__writer_cannot_be_converted, 0, 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_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, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9pywrapfst_9FarWriter_19__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9pywrapfst_9FarWriter_19__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  PyObject* values[1] = {0};
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  #if !CYTHON_METH_FASTCALL
  #if CYTHON_ASSUME_SAFE_SIZE
  __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #else
  __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  #endif
  #endif
  __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  {
    PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_pyx_state,0};
    const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
    if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
    if (__pyx_kwds_len > 0) {
      switch (__pyx_nargs) {
        case  1:
        values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
        if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      const Py_ssize_t kwd_pos_args = __pyx_nargs;
      if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__setstate_cython__", 0) < 0) __PYX_ERR(1, 3, __pyx_L3_error)
      for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
        if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, i); __PYX_ERR(1, 3, __pyx_L3_error) }
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
      if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(1, 3, __pyx_L3_error)
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L6_skip;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L6_skip:;
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __Pyx_AddTraceback("pywrapfst.FarWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9pywrapfst_9FarWriter_18__setstate_cython__(((struct __pyx_obj_9pywrapfst_FarWriter *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
    Py_XDECREF(values[__pyx_temp]);
  }
  __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
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._writer cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._writer cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
*/
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_mstate_global->__pyx_kp_u_self__writer_cannot_be_converted, 0, 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_AddTraceback("pywrapfst.FarWriter.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
/* #### Code section: module_exttypes ### */
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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst_Weight *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_Weight;
  __Pyx_default_placement_construct(&(p->_weight));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_Weight) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_weight);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_tp_richcompare_9pywrapfst_Weight(PyObject *o1, PyObject *o2, int op) {
  switch (op) {
    case Py_EQ: {
      return __pyx_pw_9pywrapfst_6Weight_19__eq__(o1, o2);
    }
    case Py_NE: {
      return __pyx_pw_9pywrapfst_6Weight_21__ne__(o1, o2);
    }
    default: {
      return __Pyx_NewRef(Py_NotImplemented);
    }
  }
}

static PyMethodDef __pyx_methods_9pywrapfst_Weight[] = {
  {"properties", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_17properties, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_16properties},
  {"zero", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_23zero, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_22zero},
  {"one", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_25one, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_24one},
  {"no_weight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_27no_weight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_6Weight_26no_weight},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_29__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_6Weight_31__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_Weight_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_Weight},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_6Weight_9__repr__},
  {Py_nb_float, (void *)__pyx_pw_9pywrapfst_6Weight_13__float__},
  {Py_tp_str, (void *)__pyx_pw_9pywrapfst_6Weight_11__str__},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_richcompare, (void *)__pyx_tp_richcompare_9pywrapfst_Weight},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_Weight},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_6Weight_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_Weight},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_Weight_spec = {
  "pywrapfst.Weight",
  sizeof(struct __pyx_obj_9pywrapfst_Weight),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_Weight_slots,
};
#else

static PyNumberMethods __pyx_tp_as_number_Weight = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_bool*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  0, /*nb_int*/
  0, /*nb_long (reserved)*/
  __pyx_pw_9pywrapfst_6Weight_13__float__, /*nb_float*/
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  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*/
  0, /*nb_matrix_multiply*/
  0, /*nb_inplace_matrix_multiply*/
};

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_6Weight_9__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_11__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n  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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9pywrapfst_6Weight_1__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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9pywrapfst_SymbolTableView __pyx_vtable_9pywrapfst_SymbolTableView;

static PyObject *__pyx_tp_new_9pywrapfst_SymbolTableView(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9pywrapfst_SymbolTableView *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_SymbolTableView;
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst_SymbolTableView(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_SymbolTableView) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_9pywrapfst_SymbolTableView[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"find", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_13find, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_12find},
  {"write_text", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_15SymbolTableView_27write_text, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_15SymbolTableView_26write_text},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_SymbolTableView_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_SymbolTableView},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_iter, (void *)__pyx_pw_9pywrapfst_15SymbolTableView_3__iter__},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_SymbolTableView},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_15SymbolTableView_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_SymbolTableView},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_SymbolTableView_spec = {
  "pywrapfst.SymbolTableView",
  sizeof(struct __pyx_obj_9pywrapfst_SymbolTableView),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_SymbolTableView_slots,
};
#else

static PyTypeObject __pyx_type_9pywrapfst_SymbolTableView = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.""SymbolTableView", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_SymbolTableView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_SymbolTableView, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n  (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_15SymbolTableView_3__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst_SymbolTableView, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst_SymbolTableView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9pywrapfst__EncodeMapperSymbolTableView __pyx_vtable_9pywrapfst__EncodeMapperSymbolTableView;

static PyObject *__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *p;
  PyObject *o = __pyx_tp_new_9pywrapfst_SymbolTableView(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView;
  __Pyx_default_placement_construct(&(p->_mapper));
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__EncodeMapperSymbolTableView(PyObject *o) {
  struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *p = (struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst__EncodeMapperSymbolTableView) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_mapper);
  __pyx_tp_dealloc_9pywrapfst_SymbolTableView(o);
}

static PyMethodDef __pyx_methods_9pywrapfst__EncodeMapperSymbolTableView[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst__EncodeMapperSymbolTableView_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst__EncodeMapperSymbolTableView},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_28_EncodeMapperSymbolTableView_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst__EncodeMapperSymbolTableView},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst__EncodeMapperSymbolTableView_spec = {
  "pywrapfst._EncodeMapperSymbolTableView",
  sizeof(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst__EncodeMapperSymbolTableView_slots,
};
#else

static PyTypeObject __pyx_type_9pywrapfst__EncodeMapperSymbolTableView = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.""_EncodeMapperSymbolTableView", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__EncodeMapperSymbolTableView, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_28_EncodeMapperSymbolTableView_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\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 || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst__EncodeMapperSymbolTableView, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst__EncodeMapperSymbolTableView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9pywrapfst__FstSymbolTableView __pyx_vtable_9pywrapfst__FstSymbolTableView;

static PyObject *__pyx_tp_new_9pywrapfst__FstSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__FstSymbolTableView *p;
  PyObject *o = __pyx_tp_new_9pywrapfst_SymbolTableView(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__FstSymbolTableView *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst__FstSymbolTableView;
  __Pyx_default_placement_construct(&(p->_fst));
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__FstSymbolTableView(PyObject *o) {
  struct __pyx_obj_9pywrapfst__FstSymbolTableView *p = (struct __pyx_obj_9pywrapfst__FstSymbolTableView *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst__FstSymbolTableView) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_fst);
  __pyx_tp_dealloc_9pywrapfst_SymbolTableView(o);
}

static PyMethodDef __pyx_methods_9pywrapfst__FstSymbolTableView[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst__FstSymbolTableView_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst__FstSymbolTableView},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_19_FstSymbolTableView_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst__FstSymbolTableView},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst__FstSymbolTableView},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst__FstSymbolTableView_spec = {
  "pywrapfst._FstSymbolTableView",
  sizeof(struct __pyx_obj_9pywrapfst__FstSymbolTableView),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst__FstSymbolTableView_slots,
};
#else

static PyTypeObject __pyx_type_9pywrapfst__FstSymbolTableView = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.""_FstSymbolTableView", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__FstSymbolTableView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__FstSymbolTableView, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_19_FstSymbolTableView_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\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 || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst__FstSymbolTableView, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst__FstSymbolTableView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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_SymbolTableView(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__MutableSymbolTable *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
  return o;
}

static PyMethodDef __pyx_methods_9pywrapfst__MutableSymbolTable[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst__MutableSymbolTable_slots[] = {
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst__MutableSymbolTable},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst__MutableSymbolTable},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst__MutableSymbolTable_spec = {
  "pywrapfst._MutableSymbolTable",
  sizeof(struct __pyx_obj_9pywrapfst__MutableSymbolTable),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst__MutableSymbolTable_slots,
};
#else

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_SymbolTableView, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n  (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 || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9pywrapfst__MutableFstSymbolTableView __pyx_vtable_9pywrapfst__MutableFstSymbolTableView;

static PyObject *__pyx_tp_new_9pywrapfst__MutableFstSymbolTableView(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *p;
  PyObject *o = __pyx_tp_new_9pywrapfst__MutableSymbolTable(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_SymbolTableView*)__pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView;
  __Pyx_default_placement_construct(&(p->_mfst));
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst__MutableFstSymbolTableView(PyObject *o) {
  struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *p = (struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst__MutableFstSymbolTableView) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_mfst);
  __pyx_tp_dealloc_9pywrapfst_SymbolTableView(o);
}

static PyMethodDef __pyx_methods_9pywrapfst__MutableFstSymbolTableView[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst__MutableFstSymbolTableView_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst__MutableFstSymbolTableView},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_26_MutableFstSymbolTableView_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\n  (No constructor.)\n\n  Mutable SymbolTable assigned to an FST.\n  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst__MutableFstSymbolTableView},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst__MutableFstSymbolTableView},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst__MutableFstSymbolTableView_spec = {
  "pywrapfst._MutableFstSymbolTableView",
  sizeof(struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst__MutableFstSymbolTableView_slots,
};
#else

static PyTypeObject __pyx_type_9pywrapfst__MutableFstSymbolTableView = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.""_MutableFstSymbolTableView", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst__MutableFstSymbolTableView, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_26_MutableFstSymbolTableView_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\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 || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst__MutableFstSymbolTableView, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst__MutableFstSymbolTableView, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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_SymbolTableView*)__pyx_vtabptr_9pywrapfst_SymbolTable;
  __Pyx_default_placement_construct(&(p->_smart_table));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_SymbolTable) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_smart_table);
  __pyx_tp_dealloc_9pywrapfst_SymbolTableView(o);
}

static PyMethodDef __pyx_methods_9pywrapfst_SymbolTable[] = {
  {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_11SymbolTable_5read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_11SymbolTable_4read},
  {"read_text", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_11SymbolTable_7read_text, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_11SymbolTable_6read_text},
  {"read_fst", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_11SymbolTable_9read_fst, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_11SymbolTable_8read_fst},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_SymbolTable_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_SymbolTable},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_11SymbolTable_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_SymbolTable},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_11SymbolTable_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_SymbolTable},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_SymbolTable_spec = {
  "pywrapfst.SymbolTable",
  sizeof(struct __pyx_obj_9pywrapfst_SymbolTable),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_SymbolTable_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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*/
  PyDoc_STR("\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 || 0
  __pyx_pw_9pywrapfst_15SymbolTableView_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_9pywrapfst__SymbolTableIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9pywrapfst__SymbolTableIterator *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst__SymbolTableIterator *)o);
  __Pyx_default_placement_construct(&(p->_it));
  p->_table = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None); Py_INCREF(Py_None);
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && !__Pyx_PyObject_GC_IsFinalized(o)) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst__SymbolTableIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->_it);
  Py_CLEAR(p->_table);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_tp_traverse_9pywrapfst__SymbolTableIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_9pywrapfst__SymbolTableIterator *p = (struct __pyx_obj_9pywrapfst__SymbolTableIterator *)o;
  {
    e = __Pyx_call_type_traverse(o, 1, v, a);
    if (e) return e;
  }
  if (p->_table) {
    e = (*v)(((PyObject *)p->_table), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_9pywrapfst__SymbolTableIterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_9pywrapfst__SymbolTableIterator *p = (struct __pyx_obj_9pywrapfst__SymbolTableIterator *)o;
  tmp = ((PyObject*)p->_table);
  p->_table = ((struct __pyx_obj_9pywrapfst_SymbolTableView *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_specialmethod___pyx_pw_9pywrapfst_20_SymbolTableIterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_9pywrapfst_20_SymbolTableIterator_7__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_9pywrapfst__SymbolTableIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_9pywrapfst_20_SymbolTableIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst__SymbolTableIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst__SymbolTableIterator},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_20_SymbolTableIterator_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\n  _SymbolTableIterator(symbols)\n\n  This class is used for iterating over a symbol table.\n  ")},
  {Py_tp_traverse, (void *)__pyx_tp_traverse_9pywrapfst__SymbolTableIterator},
  {Py_tp_clear, (void *)__pyx_tp_clear_9pywrapfst__SymbolTableIterator},
  {Py_tp_iter, (void *)__pyx_pw_9pywrapfst_20_SymbolTableIterator_5__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_9pywrapfst_20_SymbolTableIterator_7__next__},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst__SymbolTableIterator},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_20_SymbolTableIterator_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst__SymbolTableIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst__SymbolTableIterator_spec = {
  "pywrapfst._SymbolTableIterator",
  sizeof(struct __pyx_obj_9pywrapfst__SymbolTableIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
  __pyx_type_9pywrapfst__SymbolTableIterator_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_20_SymbolTableIterator_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  PyDoc_STR("\n  _SymbolTableIterator(symbols)\n\n  This class is used for iterating over a symbol table.\n  "), /*tp_doc*/
  __pyx_tp_traverse_9pywrapfst__SymbolTableIterator, /*tp_traverse*/
  __pyx_tp_clear_9pywrapfst__SymbolTableIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_9pywrapfst_20_SymbolTableIterator_5__iter__, /*tp_iter*/
  __pyx_pw_9pywrapfst_20_SymbolTableIterator_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9pywrapfst_20_SymbolTableIterator_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst_EncodeMapper *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_EncodeMapper;
  __Pyx_default_placement_construct(&(p->_mapper));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_EncodeMapper) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_mapper);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_9pywrapfst_EncodeMapper[] = {
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_7__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_13flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_12flags},
  {"properties", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_15properties, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_14properties},
  {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_17read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_16read},
  {"read_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_19read_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_18read_from_string},
  {"set_input_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_29set_input_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_28set_input_symbols},
  {"set_output_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12EncodeMapper_31set_output_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12EncodeMapper_30set_output_symbols},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_EncodeMapper_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_EncodeMapper},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_12EncodeMapper_1__repr__},
  {Py_tp_call, (void *)__pyx_pw_9pywrapfst_12EncodeMapper_5__call__},
  {Py_tp_doc, (void *)PyDoc_STR("\n  EncodeMapper(arc_type=\"standard\", encode_labels=False, encode_weights=False)\n\n  Arc mapper class, wrapping EncodeMapperClass.\n\n  This class provides an object which can be used to encode or decode FST arcs.\n  This is most useful to convert an FST to an unweighted acceptor, on which\n  some FST operations are more efficient, and then decoding the FST afterwards.\n\n  To use an instance of this class to encode or decode a mutable FST, pass it\n  as the first argument to the FST instance methods `encode` and `decode`.\n\n  For implementational reasons, it is not currently possible to use an mapper\n  on disk to construct this class.\n\n  Args:\n    arc_type: A string indicating the arc type.\n    encode_labels: Should labels be encoded?\n    encode_weights: Should weights be encoded?\n  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_EncodeMapper},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_12EncodeMapper_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_EncodeMapper},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_EncodeMapper_spec = {
  "pywrapfst.EncodeMapper",
  sizeof(struct __pyx_obj_9pywrapfst_EncodeMapper),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_EncodeMapper_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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_5__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n  EncodeMapper(arc_type=\"standard\", encode_labels=False, encode_weights=False)\n\n  Arc mapper class, wrapping EncodeMapperClass.\n\n  This class provides an object which can be used to encode or decode FST arcs.\n  This is most useful to convert an FST to an unweighted acceptor, on which\n  some FST operations are more efficient, and then decoding the FST afterwards.\n\n  To use an instance of this class to encode or decode a mutable FST, pass it\n  as the first argument to the FST instance methods `encode` and `decode`.\n\n  For implementational reasons, it is not currently possible to use an mapper\n  on disk to construct this class.\n\n  Args:\n    arc_type: A string indicating the arc type.\n    encode_labels: Should labels be encoded?\n    encode_weights: Should weights be encoded?\n  "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst_EncodeMapper, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst_Fst *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_Fst;
  __Pyx_default_placement_construct(&(p->_fst));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_Fst) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_fst);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_9pywrapfst_Fst[] = {
  {"_repr_svg_", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_1_repr_svg_, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst__repr_svg_},
  {"__reduce__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_5__reduce__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"num_states_if_known", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_25num_states_if_known, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_24num_states_if_known},
  {"properties", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_37properties, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_36properties},
  {"read", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_39read, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_38read},
  {"read_from_string", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Fst_41read_from_string, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_3Fst_40read_from_string},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_Fst_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_Fst},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_3Fst_7__repr__},
  {Py_tp_str, (void *)__pyx_pw_9pywrapfst_3Fst_9__str__},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_Fst},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_3Fst_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_Fst},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_Fst_spec = {
  "pywrapfst.Fst",
  sizeof(struct __pyx_obj_9pywrapfst_Fst),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_Fst_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_3Fst_7__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_9pywrapfst_3Fst_9__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9pywrapfst_3Fst_3__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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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;
  __Pyx_default_placement_construct(&(p->_mfst));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_MutableFst) {
      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)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_1add_arc, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_add_arc},
  {"arcsort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_7arcsort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_6arcsort},
  {"closure", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_9closure, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_8closure},
  {"concat", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_11concat, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_10concat},
  {"connect", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_13connect, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_12connect},
  {"decode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_15decode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_14decode},
  {"delete_arcs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_17delete_arcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_16delete_arcs},
  {"delete_states", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_19delete_states, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_18delete_states},
  {"encode", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_21encode, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_20encode},
  {"invert", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_23invert, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_22invert},
  {"minimize", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_25minimize, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_24minimize},
  {"mutable_input_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_29mutable_input_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_28mutable_input_symbols},
  {"mutable_output_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_31mutable_output_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_30mutable_output_symbols},
  {"project", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_35project, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_34project},
  {"prune", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_37prune, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_36prune},
  {"push", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_39push, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_38push},
  {"relabel_pairs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_41relabel_pairs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_40relabel_pairs},
  {"relabel_tables", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_43relabel_tables, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_42relabel_tables},
  {"reserve_arcs", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_45reserve_arcs, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_44reserve_arcs},
  {"reserve_states", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_47reserve_states, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_46reserve_states},
  {"reweight", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_49reweight, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_48reweight},
  {"rmepsilon", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_51rmepsilon, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_50rmepsilon},
  {"set_final", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_53set_final, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_52set_final},
  {"set_input_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_55set_input_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_54set_input_symbols},
  {"set_output_symbols", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_57set_output_symbols, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_56set_output_symbols},
  {"set_properties", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_59set_properties, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_58set_properties},
  {"set_start", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_61set_start, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_60set_start},
  {"topsort", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_63topsort, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_62topsort},
  {"union", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_10MutableFst_65union, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_10MutableFst_64union},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_MutableFst_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_MutableFst},
  {Py_tp_doc, (void *)PyDoc_STR("\n  (No constructor.)\n\n  Mutable FST class, wrapping MutableFstClass.\n\n  This class extends Fst by adding mutation operations.\n  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_MutableFst},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_MutableFst},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_MutableFst_spec = {
  "pywrapfst.MutableFst",
  sizeof(struct __pyx_obj_9pywrapfst_MutableFst),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_MutableFst_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_3Fst_7__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_3Fst_9__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_3Fst_3__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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9pywrapfst_VectorFst __pyx_vtable_9pywrapfst_VectorFst;

static PyObject *__pyx_tp_new_9pywrapfst_VectorFst(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst_VectorFst *p;
  PyObject *o = __pyx_tp_new_9pywrapfst_MutableFst(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst_VectorFst *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst_Fst*)__pyx_vtabptr_9pywrapfst_VectorFst;
  return o;
}

static PyMethodDef __pyx_methods_9pywrapfst_VectorFst[] = {
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_VectorFst_slots[] = {
  {Py_tp_doc, (void *)PyDoc_STR("\n  VectorFst(arc_type=\"standard\")\n\n  Constructs a concrete, empty, mutable FST.\n\n  Args:\n    arc_type: A string indicating the arc type.\n\n  Raises:\n    FstOpError: Unknown arc type.\n  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_VectorFst},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_9VectorFst_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_VectorFst},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_VectorFst_spec = {
  "pywrapfst.VectorFst",
  sizeof(struct __pyx_obj_9pywrapfst_VectorFst),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_VectorFst_slots,
};
#else

static PyTypeObject __pyx_type_9pywrapfst_VectorFst = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.""VectorFst", /*tp_name*/
  sizeof(struct __pyx_obj_9pywrapfst_VectorFst), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst_MutableFst, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_3Fst_7__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  #if CYTHON_COMPILING_IN_PYPY || 0
  __pyx_pw_9pywrapfst_3Fst_9__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n  VectorFst(arc_type=\"standard\")\n\n  Constructs a concrete, empty, mutable FST.\n\n  Args:\n    arc_type: A string indicating the arc type.\n\n  Raises:\n    FstOpError: Unknown arc type.\n  "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9pywrapfst_VectorFst, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9pywrapfst_9VectorFst_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst_VectorFst, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst_Arc *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_Arc;
  __Pyx_default_placement_construct(&(p->_arc));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_Arc) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_arc);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_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[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Arc_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_3Arc_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9pywrapfst_Arc[] = {
  {"ilabel", __pyx_getprop_9pywrapfst_3Arc_ilabel, __pyx_setprop_9pywrapfst_3Arc_ilabel, 0, 0},
  {"olabel", __pyx_getprop_9pywrapfst_3Arc_olabel, __pyx_setprop_9pywrapfst_3Arc_olabel, 0, 0},
  {"weight", __pyx_getprop_9pywrapfst_3Arc_weight, __pyx_setprop_9pywrapfst_3Arc_weight, 0, 0},
  {"nextstate", __pyx_getprop_9pywrapfst_3Arc_nextstate, __pyx_setprop_9pywrapfst_3Arc_nextstate, 0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_Arc_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_Arc},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_3Arc_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_Arc},
  {Py_tp_getset, (void *)__pyx_getsets_9pywrapfst_Arc},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_3Arc_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_Arc},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_Arc_spec = {
  "pywrapfst.Arc",
  sizeof(struct __pyx_obj_9pywrapfst_Arc),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_Arc_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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*/
  PyDoc_STR("\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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst__ArcIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst__ArcIterator;
  __Pyx_default_placement_construct(&(p->_fst));
  __Pyx_default_placement_construct(&(p->_it));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst__ArcIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_fst);
  __Pyx_call_destructor(p->_it);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_specialmethod___pyx_pw_9pywrapfst_12_ArcIterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_9pywrapfst_12_ArcIterator_7__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_9pywrapfst__ArcIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_9pywrapfst_12_ArcIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_11flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_10flags},
  {"set_flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_21set_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_20set_flags},
  {"value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_23value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_12_ArcIterator_22value},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_25__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_12_ArcIterator_27__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst__ArcIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst__ArcIterator},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_12_ArcIterator_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\n  _ArcIterator(ifst, state)\n\n  This class is used for iterating over the arcs leaving some state of an FST.\n  ")},
  {Py_tp_iter, (void *)__pyx_pw_9pywrapfst_12_ArcIterator_5__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_9pywrapfst_12_ArcIterator_7__next__},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst__ArcIterator},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_12_ArcIterator_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst__ArcIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst__ArcIterator_spec = {
  "pywrapfst._ArcIterator",
  sizeof(struct __pyx_obj_9pywrapfst__ArcIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst__ArcIterator_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_12_ArcIterator_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\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_12_ArcIterator_5__iter__, /*tp_iter*/
  __pyx_pw_9pywrapfst_12_ArcIterator_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9pywrapfst_12_ArcIterator_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9pywrapfst__MutableArcIterator __pyx_vtable_9pywrapfst__MutableArcIterator;

static PyObject *__pyx_tp_new_9pywrapfst__MutableArcIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_9pywrapfst__MutableArcIterator *p;
  PyObject *o = __pyx_tp_new_9pywrapfst__ArcIterator(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_9pywrapfst__MutableArcIterator *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_9pywrapfst__ArcIterator*)__pyx_vtabptr_9pywrapfst__MutableArcIterator;
  __Pyx_default_placement_construct(&(p->_mfst));
  __Pyx_default_placement_construct(&(p->_mit));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst__MutableArcIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_mfst);
  __Pyx_call_destructor(p->_mit);
  __pyx_tp_dealloc_9pywrapfst__ArcIterator(o);
}

static PyObject *__pyx_specialmethod___pyx_pw_9pywrapfst_19_MutableArcIterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_9pywrapfst_19_MutableArcIterator_7__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_9pywrapfst__MutableArcIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_9pywrapfst_19_MutableArcIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_11flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_10flags},
  {"set_flags", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_21set_flags, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_20set_flags},
  {"value", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_25value, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_19_MutableArcIterator_24value},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_27__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_19_MutableArcIterator_29__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst__MutableArcIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst__MutableArcIterator},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_19_MutableArcIterator_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_iter, (void *)__pyx_pw_9pywrapfst_19_MutableArcIterator_5__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_9pywrapfst_19_MutableArcIterator_7__next__},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst__MutableArcIterator},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_19_MutableArcIterator_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst__MutableArcIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst__MutableArcIterator_spec = {
  "pywrapfst._MutableArcIterator",
  sizeof(struct __pyx_obj_9pywrapfst__MutableArcIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst__MutableArcIterator_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_19_MutableArcIterator_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n  _MutableArcIterator(ifst, state)\n\n  This class is used for iterating over the arcs leaving some state of an FST,\n  also permitting mutation of the current arc.\n  "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_9pywrapfst_19_MutableArcIterator_5__iter__, /*tp_iter*/
  __pyx_pw_9pywrapfst_19_MutableArcIterator_7__next__, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9pywrapfst_19_MutableArcIterator_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst__StateIterator *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst__StateIterator;
  __Pyx_default_placement_construct(&(p->_fst));
  __Pyx_default_placement_construct(&(p->_it));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst__StateIterator) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_fst);
  __Pyx_call_destructor(p->_it);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_specialmethod___pyx_pw_9pywrapfst_14_StateIterator_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_9pywrapfst_14_StateIterator_7__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_9pywrapfst__StateIterator[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_9pywrapfst_14_StateIterator_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_14_StateIterator_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_14_StateIterator_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst__StateIterator_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst__StateIterator},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_14_StateIterator_1__repr__},
  {Py_tp_doc, (void *)PyDoc_STR("\n  _StateIterator(ifst)\n\n  This class is used for iterating over the states in an FST.\n  ")},
  {Py_tp_iter, (void *)__pyx_pw_9pywrapfst_14_StateIterator_5__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_9pywrapfst_14_StateIterator_7__next__},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst__StateIterator},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_14_StateIterator_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst__StateIterator},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst__StateIterator_spec = {
  "pywrapfst._StateIterator",
  sizeof(struct __pyx_obj_9pywrapfst__StateIterator),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst__StateIterator_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __pyx_pw_9pywrapfst_14_StateIterator_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\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_14_StateIterator_5__iter__, /*tp_iter*/
  __pyx_pw_9pywrapfst_14_StateIterator_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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __pyx_pw_9pywrapfst_14_StateIterator_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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst_Compiler *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_Compiler;
  __Pyx_default_placement_construct(&(p->_sstrm));
  __Pyx_default_placement_construct(&(p->_fst_type));
  __Pyx_default_placement_construct(&(p->_arc_type));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_Compiler) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_sstrm);
  __Pyx_call_destructor(p->_fst_type);
  __Pyx_call_destructor(p->_arc_type);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyMethodDef __pyx_methods_9pywrapfst_Compiler[] = {
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_8Compiler_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_8Compiler_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_Compiler_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_Compiler},
  {Py_tp_doc, (void *)PyDoc_STR("\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\n  Class used to compile FSTs from strings.\n\n  This class is used to compile FSTs specified using the AT&T FSM library\n  format described here:\n\n  http://web.eecs.umich.edu/~radev/NLP-fall2015/resources/fsm_archive/fsm.5.html\n\n  This is the same format used by the `fstcompile` executable.\n\n  Compiler options (symbol tables, etc.) are set at construction time.\n\n      compiler = fst.Compiler(isymbols=ascii_symbols, osymbols=ascii_symbols)\n\n  Once constructed, Compiler instances behave like a file handle opened for\n  writing:\n\n      # /ba+/\n      compiler.write(\"0 1 50 50\")\n      compiler.write(\"1 2 49 49\")\n      compiler.write(\"2 2 49 49\")\n      compiler.write(\"2\")\n\n  The `compile` method returns an actual FST instance:\n\n      sheep_machine = compiler.compile()\n\n  Compilation flushes the internal buffer, so the compiler instance can be\n  reused to compile new machines with the same symbol tables (etc.)\n\n  Args:\n    fst_type: A string indicating the container type for the compiled FST.\n    arc_type: A string indicating the arc type for the compiled FST.\n    isymbols: An optional SymbolTable used to label input symbols.\n    osymbols: An optional SymbolTable used to label output symbols.\n    ssymbols: An optional SymbolTable used to label states.\n    acceptor: Should the FST be rendered in acceptor format if possible?\n    keep_isymbols: Should the input symbol table be stored in the FST?\n    keep_osymbols: Should the output symbol table be stored in the FST?\n    keep_state_numbering: Should the state numbering be preserved?\n  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_Compiler},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_Compiler},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_Compiler_spec = {
  "pywrapfst.Compiler",
  sizeof(struct __pyx_obj_9pywrapfst_Compiler),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_Compiler_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  PyDoc_STR("\n  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\n  Class used to compile FSTs from strings.\n\n  This class is used to compile FSTs specified using the AT&T FSM library\n  format described here:\n\n  http://web.eecs.umich.edu/~radev/NLP-fall2015/resources/fsm_archive/fsm.5.html\n\n  This is the same format used by the `fstcompile` executable.\n\n  Compiler options (symbol tables, etc.) are set at construction time.\n\n      compiler = fst.Compiler(isymbols=ascii_symbols, osymbols=ascii_symbols)\n\n  Once constructed, Compiler instances behave like a file handle opened for\n  writing:\n\n      # /ba+/\n      compiler.write(\"0 1 50 50\")\n      compiler.write(\"1 2 49 49\")\n      compiler.write(\"2 2 49 49\")\n      compiler.write(\"2\")\n\n  The `compile` method returns an actual FST instance:\n\n      sheep_machine = compiler.compile()\n\n  Compilation flushes the internal buffer, so the compiler instance can be\n  reused to compile new machines with the same symbol tables (etc.)\n\n  Args:\n    fst_type: A string indicating the container type for the compiled FST.\n    arc_type: A string indicating the arc type for the compiled FST.\n    isymbols: An optional SymbolTable used to label input symbols.\n    osymbols: An optional SymbolTable used to label output symbols.\n    ssymbols: An optional SymbolTable used to label states.\n    acceptor: Should the FST be rendered in acceptor format if possible?\n    keep_isymbols: Should the input symbol table be stored in the FST?\n    keep_osymbols: Should the output symbol table be stored in the FST?\n    keep_state_numbering: Should the state numbering be preserved?\n  "), /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst_FarReader *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_FarReader;
  __Pyx_default_placement_construct(&(p->_reader));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_FarReader) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_reader);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static PyObject *__pyx_sq_item_9pywrapfst_FarReader(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyLong_FromSsize_t(i); if(!x) return 0;
  #if CYTHON_USE_TYPE_SLOTS || (!CYTHON_USE_TYPE_SPECS && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  #else
  r = ((binaryfunc)PyType_GetSlot(Py_TYPE(o), Py_mp_subscript))(o, x);
  #endif
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_specialmethod___pyx_pw_9pywrapfst_9FarReader_27__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {
  PyObject *res = __pyx_pw_9pywrapfst_9FarReader_27__next__(self);
  if (!res && !PyErr_Occurred()) { PyErr_SetNone(PyExc_StopIteration); }
  return res;
}

static PyMethodDef __pyx_methods_9pywrapfst_FarReader[] = {
  {"open", (PyCFunction)(void(*)(void))(PyCFunctionWithKeywords)__pyx_pw_9pywrapfst_9FarReader_5open, METH_VARARGS|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarReader_4open},
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_9pywrapfst_9FarReader_27__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_31__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarReader_33__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_FarReader_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_FarReader},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_9FarReader_3__repr__},
  {Py_sq_item, (void *)__pyx_sq_item_9pywrapfst_FarReader},
  {Py_mp_subscript, (void *)__pyx_pw_9pywrapfst_9FarReader_25__getitem__},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_iter, (void *)__pyx_pw_9pywrapfst_9FarReader_29__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_9pywrapfst_9FarReader_27__next__},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_FarReader},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_9FarReader_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_FarReader},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_FarReader_spec = {
  "pywrapfst.FarReader",
  sizeof(struct __pyx_obj_9pywrapfst_FarReader),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_FarReader_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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*/
  PyDoc_STR("\n  (No constructor.)\n\n  FAR (\"Fst ARchive\") reader object.\n\n  This class is used to read a FAR from disk. FARs contain one or more FSTs (of\n  the same arc type) indexed by a unique string key. To construct a FarReader\n  object, use the `open` class method.\n\n  Attributes:\n    arc_type: A string indicating the arc type.\n    far_type: A string indicating the FAR type.\n  "), /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_9pywrapfst_9FarReader_29__iter__, /*tp_iter*/
  __pyx_pw_9pywrapfst_9FarReader_27__next__, /*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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_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 CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_mstate_global->__pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9pywrapfst_FarWriter *)o);
  p->__pyx_vtab = __pyx_vtabptr_9pywrapfst_FarWriter;
  __Pyx_default_placement_construct(&(p->_writer));
  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((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst_FarWriter) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  __Pyx_call_destructor(p->_writer);
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}

static int __pyx_mp_ass_subscript_9pywrapfst_FarWriter(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_9pywrapfst_9FarWriter_15__setitem__(o, i, v);
  }
  else {
    __Pyx_TypeName o_type_name;
    o_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(o));
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by " __Pyx_FMT_TYPENAME, o_type_name);
    __Pyx_DECREF_TypeName(o_type_name);
    return -1;
  }
}

static PyMethodDef __pyx_methods_9pywrapfst_FarWriter[] = {
  {"create", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_5create, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9pywrapfst_9FarWriter_4create},
  {"__reduce_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_17__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9pywrapfst_9FarWriter_19__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst_FarWriter_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst_FarWriter},
  {Py_tp_repr, (void *)__pyx_pw_9pywrapfst_9FarWriter_3__repr__},
  {Py_mp_ass_subscript, (void *)__pyx_mp_ass_subscript_9pywrapfst_FarWriter},
  {Py_tp_doc, (void *)PyDoc_STR("\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  ")},
  {Py_tp_methods, (void *)__pyx_methods_9pywrapfst_FarWriter},
  {Py_tp_init, (void *)__pyx_pw_9pywrapfst_9FarWriter_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst_FarWriter},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst_FarWriter_spec = {
  "pywrapfst.FarWriter",
  sizeof(struct __pyx_obj_9pywrapfst_FarWriter),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9pywrapfst_FarWriter_slots,
};
#else

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*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  __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*/
  PyDoc_STR("\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*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  __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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_9pywrapfst___pyx_defaults(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  o = (*t->tp_alloc)(t, 0);
  if (unlikely(!o)) return 0;
  #endif
  return o;
}

static void __pyx_tp_dealloc_9pywrapfst___pyx_defaults(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) {
    if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9pywrapfst___pyx_defaults) {
      if (PyObject_CallFinalizerFromDealloc(o)) return;
    }
  }
  #endif
  #if CYTHON_USE_TYPE_SLOTS
  (*Py_TYPE(o)->tp_free)(o);
  #else
  {
    freefunc tp_free = (freefunc)PyType_GetSlot(Py_TYPE(o), Py_tp_free);
    if (tp_free) tp_free(o);
  }
  #endif
}
#if CYTHON_USE_TYPE_SPECS
static PyType_Slot __pyx_type_9pywrapfst___pyx_defaults_slots[] = {
  {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9pywrapfst___pyx_defaults},
  {Py_tp_new, (void *)__pyx_tp_new_9pywrapfst___pyx_defaults},
  {0, 0},
};
static PyType_Spec __pyx_type_9pywrapfst___pyx_defaults_spec = {
  "pywrapfst.__pyx_defaults",
  sizeof(struct __pyx_defaults),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE,
  __pyx_type_9pywrapfst___pyx_defaults_slots,
};
#else

static PyTypeObject __pyx_type_9pywrapfst___pyx_defaults = {
  PyVarObject_HEAD_INIT(0, 0)
  "pywrapfst.""__pyx_defaults", /*tp_name*/
  sizeof(struct __pyx_defaults), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9pywrapfst___pyx_defaults, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_as_async*/
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_FINALIZE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  #if !CYTHON_USE_TYPE_SPECS
  0, /*tp_dictoffset*/
  #endif
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9pywrapfst___pyx_defaults, /*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 CYTHON_USE_TP_FINALIZE
  0, /*tp_finalize*/
  #else
  NULL, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if __PYX_NEED_TP_PRINT_SLOT == 1
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030C0000
  0, /*tp_watched*/
  #endif
  #if PY_VERSION_HEX >= 0x030d00A4
  0, /*tp_versions_used*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
/* #### Code section: initfunc_declarations ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
/* #### Code section: init_module ### */

static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("tostring", (void (*)(void))__pyx_f_9pywrapfst_tostring, "std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("weight_tostring", (void (*)(void))__pyx_f_9pywrapfst_weight_tostring, "std::string (PyObject *)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("path_tostring", (void (*)(void))__pyx_f_9pywrapfst_path_tostring, "std::string (PyObject *)") < 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, "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("_no_weight", (void (*)(void))__pyx_f_9pywrapfst__no_weight, "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_EncodeMapperSymbolTableView", (void (*)(void))__pyx_f_9pywrapfst__init_EncodeMapperSymbolTableView, "struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *(std::shared_ptr<fst::script::EncodeMapperClass> , bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_FstSymbolTableView", (void (*)(void))__pyx_f_9pywrapfst__init_FstSymbolTableView, "struct __pyx_obj_9pywrapfst__FstSymbolTableView *(std::shared_ptr<fst::script::FstClass> , bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_MutableFstSymbolTableView", (void (*)(void))__pyx_f_9pywrapfst__init_MutableFstSymbolTableView, "struct __pyx_obj_9pywrapfst__MutableFstSymbolTableView *(std::shared_ptr<fst::script::MutableFstClass> , bool)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_SymbolTable", (void (*)(void))__pyx_f_9pywrapfst__init_SymbolTable, "struct __pyx_obj_9pywrapfst_SymbolTable *(std::unique_ptr<fst::SymbolTable> )") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read_SymbolTable_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_SymbolTable_from_string, "struct __pyx_obj_9pywrapfst_SymbolTable *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_EncodeMapper", (void (*)(void))__pyx_f_9pywrapfst__init_EncodeMapper, "struct __pyx_obj_9pywrapfst_EncodeMapper *(__pyx_t_9pywrapfst_EncodeMapperClass_ptr)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read_EncodeMapper_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_EncodeMapper_from_string, "struct __pyx_obj_9pywrapfst_EncodeMapper *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_Fst", (void (*)(void))__pyx_f_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("_read_Fst", (void (*)(void))__pyx_f_9pywrapfst__read_Fst, "struct __pyx_obj_9pywrapfst_Fst *(PyObject *, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_read_Fst_from_string", (void (*)(void))__pyx_f_9pywrapfst__read_Fst_from_string, "struct __pyx_obj_9pywrapfst_Fst *(std::string, int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("_init_Arc", (void (*)(void))__pyx_f_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, "void (struct __pyx_obj_9pywrapfst_Fst *, std::vector<fst::script::WeightClass>  *, 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)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_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.type = (std::string (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_type;
  __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.member = (bool (*)(struct __pyx_obj_9pywrapfst_Weight *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_6Weight_member;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst_Weight = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_Weight_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_Weight)) __PYX_ERR(0, 482, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_Weight_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_Weight) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_Weight = &__pyx_type_9pywrapfst_Weight;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_Weight) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_Weight->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_Weight->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_Weight->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_Weight, __pyx_vtabptr_9pywrapfst_Weight) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_Weight) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Weight_2, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_Weight) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_Weight) < 0) __PYX_ERR(0, 482, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst_SymbolTableView = &__pyx_vtable_9pywrapfst_SymbolTableView;
  __pyx_vtable_9pywrapfst_SymbolTableView._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_15SymbolTableView__raw;
  __pyx_vtable_9pywrapfst_SymbolTableView._raise_nonexistent = (void (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_15SymbolTableView__raise_nonexistent;
  __pyx_vtable_9pywrapfst_SymbolTableView._raw_ptr_or_raise = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_15SymbolTableView__raw_ptr_or_raise;
  __pyx_vtable_9pywrapfst_SymbolTableView.available_key = (int64_t (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_available_key;
  __pyx_vtable_9pywrapfst_SymbolTableView.checksum = (PyObject *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_checksum;
  __pyx_vtable_9pywrapfst_SymbolTableView.copy = (struct __pyx_obj_9pywrapfst_SymbolTable *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_copy;
  __pyx_vtable_9pywrapfst_SymbolTableView.get_nth_key = (int64_t (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, Py_ssize_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_get_nth_key;
  __pyx_vtable_9pywrapfst_SymbolTableView.labeled_checksum = (PyObject *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_labeled_checksum;
  __pyx_vtable_9pywrapfst_SymbolTableView.member = (bool (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_member;
  __pyx_vtable_9pywrapfst_SymbolTableView.name = (std::string (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_name;
  __pyx_vtable_9pywrapfst_SymbolTableView.num_symbols = (size_t (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_num_symbols;
  __pyx_vtable_9pywrapfst_SymbolTableView.write = (void (*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_write;
  __pyx_vtable_9pywrapfst_SymbolTableView.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_15SymbolTableView_write_to_string;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_SymbolTableView_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView)) __PYX_ERR(0, 822, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_SymbolTableView_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 822, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView = &__pyx_type_9pywrapfst_SymbolTableView;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 822, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_vtabptr_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 822, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 822, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SymbolTableView, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTableView) < 0) __PYX_ERR(0, 822, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView = &__pyx_vtable_9pywrapfst__EncodeMapperSymbolTableView;
  __pyx_vtable_9pywrapfst__EncodeMapperSymbolTableView.__pyx_base = *__pyx_vtabptr_9pywrapfst_SymbolTableView;
  __pyx_vtable_9pywrapfst__EncodeMapperSymbolTableView.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_28_EncodeMapperSymbolTableView__raw;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst__EncodeMapperSymbolTableView_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView)) __PYX_ERR(0, 1042, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst__EncodeMapperSymbolTableView_spec, __pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 1042, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView = &__pyx_type_9pywrapfst__EncodeMapperSymbolTableView;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView->tp_base = __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 1042, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView, __pyx_vtabptr_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 1042, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 1042, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_EncodeMapperSymbolTableView, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__EncodeMapperSymbolTableView) < 0) __PYX_ERR(0, 1042, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst__FstSymbolTableView = &__pyx_vtable_9pywrapfst__FstSymbolTableView;
  __pyx_vtable_9pywrapfst__FstSymbolTableView.__pyx_base = *__pyx_vtabptr_9pywrapfst_SymbolTableView;
  __pyx_vtable_9pywrapfst__FstSymbolTableView.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_19_FstSymbolTableView__raw;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst__FstSymbolTableView_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView)) __PYX_ERR(0, 1066, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst__FstSymbolTableView_spec, __pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 1066, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView = &__pyx_type_9pywrapfst__FstSymbolTableView;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_9pywrapfst__FstSymbolTableView->tp_base = __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 1066, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView, __pyx_vtabptr_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 1066, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 1066, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FstSymbolTableView, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__FstSymbolTableView) < 0) __PYX_ERR(0, 1066, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst__MutableSymbolTable = &__pyx_vtable_9pywrapfst__MutableSymbolTable;
  __pyx_vtable_9pywrapfst__MutableSymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst_SymbolTableView;
  __pyx_vtable_9pywrapfst__MutableSymbolTable.__pyx_base._raw = (fst::SymbolTable const *(*)(struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_19_MutableSymbolTable__raw;
  __pyx_vtable_9pywrapfst__MutableSymbolTable._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *))__pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw;
  __pyx_vtable_9pywrapfst__MutableSymbolTable._mutable_raw_ptr_or_raise = (fst::SymbolTable *(*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *))__pyx_f_9pywrapfst_19_MutableSymbolTable__mutable_raw_ptr_or_raise;
  __pyx_vtable_9pywrapfst__MutableSymbolTable.add_symbol = (int64_t (*)(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_SymbolTableView *, 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;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst__MutableSymbolTable_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable)) __PYX_ERR(0, 1089, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst__MutableSymbolTable_spec, __pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 1089, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable = &__pyx_type_9pywrapfst__MutableSymbolTable;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable->tp_base = __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 1089, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable, __pyx_vtabptr_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 1089, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 1089, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MutableSymbolTable, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__MutableSymbolTable) < 0) __PYX_ERR(0, 1089, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView = &__pyx_vtable_9pywrapfst__MutableFstSymbolTableView;
  __pyx_vtable_9pywrapfst__MutableFstSymbolTableView.__pyx_base = *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
  __pyx_vtable_9pywrapfst__MutableFstSymbolTableView.__pyx_base._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *))__pyx_f_9pywrapfst_26_MutableFstSymbolTableView__mutable_raw;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst__MutableFstSymbolTableView_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView)) __PYX_ERR(0, 1170, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst__MutableFstSymbolTableView_spec, __pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1170, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView = &__pyx_type_9pywrapfst__MutableFstSymbolTableView;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView->tp_base = __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1170, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView, __pyx_vtabptr_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1170, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1170, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MutableFstSymbolTableView, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__MutableFstSymbolTableView) < 0) __PYX_ERR(0, 1170, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst_SymbolTable = &__pyx_vtable_9pywrapfst_SymbolTable;
  __pyx_vtable_9pywrapfst_SymbolTable.__pyx_base = *__pyx_vtabptr_9pywrapfst__MutableSymbolTable;
  __pyx_vtable_9pywrapfst_SymbolTable.__pyx_base._mutable_raw = (fst::SymbolTable *(*)(struct __pyx_obj_9pywrapfst__MutableSymbolTable *))__pyx_f_9pywrapfst_11SymbolTable__mutable_raw;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_SymbolTable_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable)) __PYX_ERR(0, 1185, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_SymbolTable_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable = &__pyx_type_9pywrapfst_SymbolTable;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable->tp_base = __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_vtabptr_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SymbolTable_2, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_SymbolTable) < 0) __PYX_ERR(0, 1185, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst__SymbolTableIterator_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator)) __PYX_ERR(0, 1391, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst__SymbolTableIterator_spec, __pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator = &__pyx_type_9pywrapfst__SymbolTableIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_SymbolTableIterator, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__SymbolTableIterator) < 0) __PYX_ERR(0, 1391, __pyx_L1_error)
  __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._properties = (uint64_t (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, uint64_t))__pyx_f_9pywrapfst_12EncodeMapper__properties;
  __pyx_vtable_9pywrapfst_EncodeMapper.weight_type = (std::string (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_weight_type;
  __pyx_vtable_9pywrapfst_EncodeMapper.write = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_write;
  __pyx_vtable_9pywrapfst_EncodeMapper.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_write_to_string;
  __pyx_vtable_9pywrapfst_EncodeMapper.input_symbols = (struct __pyx_obj_9pywrapfst__EncodeMapperSymbolTableView *(*)(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__EncodeMapperSymbolTableView *(*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12EncodeMapper_output_symbols;
  __pyx_vtable_9pywrapfst_EncodeMapper._set_input_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_12EncodeMapper__set_input_symbols;
  __pyx_vtable_9pywrapfst_EncodeMapper._set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst_EncodeMapper *, struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_12EncodeMapper__set_output_symbols;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_EncodeMapper_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper)) __PYX_ERR(0, 1423, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_EncodeMapper_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1423, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper = &__pyx_type_9pywrapfst_EncodeMapper;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1423, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_UPDATE_DESCRIPTOR_DOC
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)__pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper, "__call__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1423, __pyx_L1_error)
    if (__Pyx_IS_TYPE(wrapper, &PyWrapperDescr_Type)) {
      __pyx_wrapperbase_9pywrapfst_12EncodeMapper_4__call__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_9pywrapfst_12EncodeMapper_4__call__.doc = __pyx_doc_9pywrapfst_12EncodeMapper_4__call__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_9pywrapfst_12EncodeMapper_4__call__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_vtabptr_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1423, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1423, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_EncodeMapper, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_EncodeMapper) < 0) __PYX_ERR(0, 1423, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst_Fst = &__pyx_vtable_9pywrapfst_Fst;
  __pyx_vtable_9pywrapfst_Fst._server_render_svg = (std::string (*)(std::string const &))__pyx_f_9pywrapfst_3Fst__server_render_svg;
  __pyx_vtable_9pywrapfst_Fst._local_render_svg = (std::string (*)(std::string const &))__pyx_f_9pywrapfst_3Fst__local_render_svg;
  __pyx_vtable_9pywrapfst_Fst.arc_type = (std::string (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_arc_type;
  __pyx_vtable_9pywrapfst_Fst.arcs = (struct __pyx_obj_9pywrapfst__ArcIterator *(*)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_arcs;
  __pyx_vtable_9pywrapfst_Fst.copy = (struct __pyx_obj_9pywrapfst_Fst *(*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_copy;
  __pyx_vtable_9pywrapfst_Fst.draw = (void (*)(struct __pyx_obj_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_draw *__pyx_optional_args))__pyx_f_9pywrapfst_3Fst_draw;
  __pyx_vtable_9pywrapfst_Fst.final = (struct __pyx_obj_9pywrapfst_Weight *(*)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_final;
  __pyx_vtable_9pywrapfst_Fst.fst_type = (std::string (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_fst_type;
  __pyx_vtable_9pywrapfst_Fst.input_symbols = (struct __pyx_obj_9pywrapfst__FstSymbolTableView *(*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_input_symbols;
  __pyx_vtable_9pywrapfst_Fst.num_arcs = (size_t (*)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_num_arcs;
  __pyx_vtable_9pywrapfst_Fst.num_input_epsilons = (size_t (*)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_num_input_epsilons;
  __pyx_vtable_9pywrapfst_Fst.num_output_epsilons = (size_t (*)(struct __pyx_obj_9pywrapfst_Fst *, int64_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_num_output_epsilons;
  __pyx_vtable_9pywrapfst_Fst.output_symbols = (struct __pyx_obj_9pywrapfst__FstSymbolTableView *(*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_output_symbols;
  __pyx_vtable_9pywrapfst_Fst.print = (std::string (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch, struct __pyx_opt_args_9pywrapfst_3Fst_print *__pyx_optional_args))__pyx_f_9pywrapfst_3Fst_print;
  __pyx_vtable_9pywrapfst_Fst._properties = (uint64_t (*)(struct __pyx_obj_9pywrapfst_Fst *, uint64_t, bool))__pyx_f_9pywrapfst_3Fst__properties;
  __pyx_vtable_9pywrapfst_Fst.start = (int64_t (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_start;
  __pyx_vtable_9pywrapfst_Fst.states = (struct __pyx_obj_9pywrapfst__StateIterator *(*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_states;
  __pyx_vtable_9pywrapfst_Fst.verify = (bool (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_verify;
  __pyx_vtable_9pywrapfst_Fst.weight_type = (std::string (*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_weight_type;
  __pyx_vtable_9pywrapfst_Fst.write = (void (*)(struct __pyx_obj_9pywrapfst_Fst *, PyObject *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_write;
  __pyx_vtable_9pywrapfst_Fst.write_to_string = (PyObject *(*)(struct __pyx_obj_9pywrapfst_Fst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_3Fst_write_to_string;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst_Fst = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_Fst_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_Fst)) __PYX_ERR(0, 1714, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_Fst_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_Fst = &__pyx_type_9pywrapfst_Fst;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_Fst->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_Fst->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_Fst->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_Fst, __pyx_vtabptr_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Fst, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_Fst) < 0) __PYX_ERR(0, 1714, __pyx_L1_error)
  __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_10MutableFst__check_mutating_imethod;
  __pyx_vtable_9pywrapfst_MutableFst._add_arc = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t, struct __pyx_obj_9pywrapfst_Arc *))__pyx_f_9pywrapfst_10MutableFst__add_arc;
  __pyx_vtable_9pywrapfst_MutableFst.add_state = (int64_t (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_10MutableFst_add_state;
  __pyx_vtable_9pywrapfst_MutableFst.add_states = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, size_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_10MutableFst_add_states;
  __pyx_vtable_9pywrapfst_MutableFst._arcsort = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__arcsort *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__arcsort;
  __pyx_vtable_9pywrapfst_MutableFst._closure = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__closure *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__closure;
  __pyx_vtable_9pywrapfst_MutableFst._concat = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_Fst *))__pyx_f_9pywrapfst_10MutableFst__concat;
  __pyx_vtable_9pywrapfst_MutableFst._connect = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *))__pyx_f_9pywrapfst_10MutableFst__connect;
  __pyx_vtable_9pywrapfst_MutableFst._decode = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_EncodeMapper *))__pyx_f_9pywrapfst_10MutableFst__decode;
  __pyx_vtable_9pywrapfst_MutableFst._delete_arcs = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t, struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_arcs *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__delete_arcs;
  __pyx_vtable_9pywrapfst_MutableFst._delete_states = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__delete_states *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__delete_states;
  __pyx_vtable_9pywrapfst_MutableFst._encode = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_EncodeMapper *))__pyx_f_9pywrapfst_10MutableFst__encode;
  __pyx_vtable_9pywrapfst_MutableFst._invert = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *))__pyx_f_9pywrapfst_10MutableFst__invert;
  __pyx_vtable_9pywrapfst_MutableFst._minimize = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__minimize *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__minimize;
  __pyx_vtable_9pywrapfst_MutableFst.mutable_arcs = (struct __pyx_obj_9pywrapfst__MutableArcIterator *(*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_10MutableFst_mutable_arcs;
  __pyx_vtable_9pywrapfst_MutableFst.num_states = (int64_t (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_10MutableFst_num_states;
  __pyx_vtable_9pywrapfst_MutableFst._project = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, PyObject *))__pyx_f_9pywrapfst_10MutableFst__project;
  __pyx_vtable_9pywrapfst_MutableFst._prune = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__prune *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__prune;
  __pyx_vtable_9pywrapfst_MutableFst._push = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__push *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__push;
  __pyx_vtable_9pywrapfst_MutableFst._relabel_pairs = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_pairs *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__relabel_pairs;
  __pyx_vtable_9pywrapfst_MutableFst._relabel_tables = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__relabel_tables *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__relabel_tables;
  __pyx_vtable_9pywrapfst_MutableFst._reserve_arcs = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t, size_t))__pyx_f_9pywrapfst_10MutableFst__reserve_arcs;
  __pyx_vtable_9pywrapfst_MutableFst._reserve_states = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t))__pyx_f_9pywrapfst_10MutableFst__reserve_states;
  __pyx_vtable_9pywrapfst_MutableFst._reweight = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, PyObject *, struct __pyx_opt_args_9pywrapfst_10MutableFst__reweight *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__reweight;
  __pyx_vtable_9pywrapfst_MutableFst._rmepsilon = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_opt_args_9pywrapfst_10MutableFst__rmepsilon *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__rmepsilon;
  __pyx_vtable_9pywrapfst_MutableFst._set_final = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t, struct __pyx_opt_args_9pywrapfst_10MutableFst__set_final *__pyx_optional_args))__pyx_f_9pywrapfst_10MutableFst__set_final;
  __pyx_vtable_9pywrapfst_MutableFst._set_start = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, int64_t))__pyx_f_9pywrapfst_10MutableFst__set_start;
  __pyx_vtable_9pywrapfst_MutableFst._set_input_symbols = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_10MutableFst__set_input_symbols;
  __pyx_vtable_9pywrapfst_MutableFst._set_output_symbols = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *, struct __pyx_obj_9pywrapfst_SymbolTableView *))__pyx_f_9pywrapfst_10MutableFst__set_output_symbols;
  __pyx_vtable_9pywrapfst_MutableFst._topsort = (void (*)(struct __pyx_obj_9pywrapfst_MutableFst *))__pyx_f_9pywrapfst_10MutableFst__topsort;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_MutableFst_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst)) __PYX_ERR(0, 2242, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_MutableFst_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst = &__pyx_type_9pywrapfst_MutableFst;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst->tp_base = __pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst, __pyx_vtabptr_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MutableFst, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_MutableFst) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst_VectorFst = &__pyx_vtable_9pywrapfst_VectorFst;
  __pyx_vtable_9pywrapfst_VectorFst.__pyx_base = *__pyx_vtabptr_9pywrapfst_MutableFst;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_VectorFst_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst)) __PYX_ERR(0, 3173, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_VectorFst_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 3173, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst = &__pyx_type_9pywrapfst_VectorFst;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_9pywrapfst_VectorFst->tp_base = __pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 3173, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst, __pyx_vtabptr_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 3173, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 3173, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_VectorFst, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_VectorFst) < 0) __PYX_ERR(0, 3173, __pyx_L1_error)
  __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 CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst_Arc = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_Arc_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_Arc)) __PYX_ERR(0, 3383, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_Arc_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_Arc = &__pyx_type_9pywrapfst_Arc;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_Arc->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_Arc->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_Arc->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_Arc, __pyx_vtabptr_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Arc, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_Arc) < 0) __PYX_ERR(0, 3383, __pyx_L1_error)
  __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_12_ArcIterator_done;
  __pyx_vtable_9pywrapfst__ArcIterator.next = (void (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_ArcIterator_next;
  __pyx_vtable_9pywrapfst__ArcIterator.position = (size_t (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_ArcIterator_position;
  __pyx_vtable_9pywrapfst__ArcIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_ArcIterator_reset;
  __pyx_vtable_9pywrapfst__ArcIterator.seek = (void (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, size_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_12_ArcIterator_seek;
  __pyx_vtable_9pywrapfst__ArcIterator._value = (struct __pyx_obj_9pywrapfst_Arc *(*)(struct __pyx_obj_9pywrapfst__ArcIterator *))__pyx_f_9pywrapfst_12_ArcIterator__value;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst__ArcIterator_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator)) __PYX_ERR(0, 3453, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst__ArcIterator_spec, __pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3453, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator = &__pyx_type_9pywrapfst__ArcIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3453, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_vtabptr_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3453, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3453, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_ArcIterator, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3453, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__ArcIterator) < 0) __PYX_ERR(0, 3453, __pyx_L1_error)
  __pyx_vtabptr_9pywrapfst__MutableArcIterator = &__pyx_vtable_9pywrapfst__MutableArcIterator;
  __pyx_vtable_9pywrapfst__MutableArcIterator.__pyx_base = *__pyx_vtabptr_9pywrapfst__ArcIterator;
  __pyx_vtable_9pywrapfst__MutableArcIterator.__pyx_base.done = (bool (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableArcIterator_done;
  __pyx_vtable_9pywrapfst__MutableArcIterator.__pyx_base.next = (void (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableArcIterator_next;
  __pyx_vtable_9pywrapfst__MutableArcIterator.__pyx_base.position = (size_t (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableArcIterator_position;
  __pyx_vtable_9pywrapfst__MutableArcIterator.__pyx_base.reset = (void (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableArcIterator_reset;
  __pyx_vtable_9pywrapfst__MutableArcIterator.__pyx_base.seek = (void (*)(struct __pyx_obj_9pywrapfst__ArcIterator *, size_t, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableArcIterator_seek;
  __pyx_vtable_9pywrapfst__MutableArcIterator.__pyx_base._value = (struct __pyx_obj_9pywrapfst_Arc *(*)(struct __pyx_obj_9pywrapfst__ArcIterator *))__pyx_f_9pywrapfst_19_MutableArcIterator__value;
  __pyx_vtable_9pywrapfst__MutableArcIterator.set_value = (void (*)(struct __pyx_obj_9pywrapfst__MutableArcIterator *, struct __pyx_obj_9pywrapfst_Arc *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_19_MutableArcIterator_set_value;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_t_1 = PyTuple_Pack(1, (PyObject *)__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst__MutableArcIterator_spec, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator)) __PYX_ERR(0, 3591, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst__MutableArcIterator_spec, __pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3591, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator = &__pyx_type_9pywrapfst__MutableArcIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  __pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator->tp_base = __pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator;
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3591, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_vtabptr_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3591, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3591, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_MutableArcIterator, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3591, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__MutableArcIterator) < 0) __PYX_ERR(0, 3591, __pyx_L1_error)
  __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_14_StateIterator_done;
  __pyx_vtable_9pywrapfst__StateIterator.next = (void (*)(struct __pyx_obj_9pywrapfst__StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_14_StateIterator_next;
  __pyx_vtable_9pywrapfst__StateIterator.reset = (void (*)(struct __pyx_obj_9pywrapfst__StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_14_StateIterator_reset;
  __pyx_vtable_9pywrapfst__StateIterator._value = (int64_t (*)(struct __pyx_obj_9pywrapfst__StateIterator *))__pyx_f_9pywrapfst_14_StateIterator__value;
  __pyx_vtable_9pywrapfst__StateIterator.value = (int64_t (*)(struct __pyx_obj_9pywrapfst__StateIterator *, int __pyx_skip_dispatch))__pyx_f_9pywrapfst_14_StateIterator_value;
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst__StateIterator_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator)) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst__StateIterator_spec, __pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator = &__pyx_type_9pywrapfst__StateIterator;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator, __pyx_vtabptr_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_StateIterator, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst__StateIterator) < 0) __PYX_ERR(0, 3754, __pyx_L1_error)
  __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 CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst_Compiler = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_Compiler_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_Compiler)) __PYX_ERR(0, 4712, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_Compiler_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4712, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_Compiler = &__pyx_type_9pywrapfst_Compiler;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4712, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_Compiler->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_Compiler->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_Compiler->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_Compiler, __pyx_vtabptr_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4712, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4712, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_Compiler, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4712, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_Compiler) < 0) __PYX_ERR(0, 4712, __pyx_L1_error)
  __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 CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst_FarReader = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_FarReader_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_FarReader)) __PYX_ERR(0, 4844, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_FarReader_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4844, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_FarReader = &__pyx_type_9pywrapfst_FarReader;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4844, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_FarReader->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_FarReader->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_FarReader->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_FarReader, __pyx_vtabptr_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4844, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4844, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FarReader, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4844, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_FarReader) < 0) __PYX_ERR(0, 4844, __pyx_L1_error)
  __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 CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst_FarWriter_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter)) __PYX_ERR(0, 5010, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst_FarWriter_spec, __pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 5010, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter = &__pyx_type_9pywrapfst_FarWriter;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 5010, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  if (__Pyx_SetVtable(__pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter, __pyx_vtabptr_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 5010, __pyx_L1_error)
  if (__Pyx_MergeVtables(__pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 5010, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_FarWriter, (PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 5010, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject *) __pyx_mstate->__pyx_ptype_9pywrapfst_FarWriter) < 0) __PYX_ERR(0, 5010, __pyx_L1_error)
  #if CYTHON_USE_TYPE_SPECS
  __pyx_mstate->__pyx_ptype_9pywrapfst___pyx_defaults = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9pywrapfst___pyx_defaults_spec, NULL); if (unlikely(!__pyx_mstate->__pyx_ptype_9pywrapfst___pyx_defaults)) __PYX_ERR(0, 4565, __pyx_L1_error)
  if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9pywrapfst___pyx_defaults_spec, __pyx_mstate->__pyx_ptype_9pywrapfst___pyx_defaults) < 0) __PYX_ERR(0, 4565, __pyx_L1_error)
  #else
  __pyx_mstate->__pyx_ptype_9pywrapfst___pyx_defaults = &__pyx_type_9pywrapfst___pyx_defaults;
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  #endif
  #if !CYTHON_USE_TYPE_SPECS
  if (__Pyx_PyType_Ready(__pyx_mstate->__pyx_ptype_9pywrapfst___pyx_defaults) < 0) __PYX_ERR(0, 4565, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_mstate->__pyx_ptype_9pywrapfst___pyx_defaults->tp_dictoffset && __pyx_mstate->__pyx_ptype_9pywrapfst___pyx_defaults->tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_mstate->__pyx_ptype_9pywrapfst___pyx_defaults->tp_getattro = PyObject_GenericGetAttr;
  }
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

#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},
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  {Py_mod_gil, Py_MOD_GIL_USED},
  #endif
  #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  #endif
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "pywrapfst",
      __pyx_k_Python_interface_to_the_FST_scri, /* m_doc */
    #if CYTHON_USE_MODULE_STATE
      sizeof(__pyx_mstatetype), /* m_size */
    #else
      (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_USE_MODULE_STATE
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif

/* PyModInitFuncType */
#ifndef CYTHON_NO_PYINIT_EXPORT
  #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#else
  #ifdef __cplusplus
  #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  #else
  #define __Pyx_PyMODINIT_FUNC PyObject *
  #endif
#endif

__Pyx_PyMODINIT_FUNC PyInit_pywrapfst(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_pywrapfst(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
/* ModuleCreationPEP489 */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
    {
        PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
        if (!module) {
            PyErr_Clear(); // just try the 3.8-3.12 version
            module = PyImport_ImportModule("_xxsubinterpreters");
            if (!module) goto bad;
        }
        PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
        Py_DECREF(module);
        if (!current) goto bad;
        if (PyTuple_Check(current)) {
            PyObject *new_current = PySequence_GetItem(current, 0);
            Py_DECREF(current);
            current = new_current;
            if (!new_current) goto bad;
        }
        long long as_c_int = PyLong_AsLongLong(current);
        Py_DECREF(current);
        return as_c_int;
    }
  bad:
    PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
    return -1;
}
#endif
#if !CYTHON_USE_MODULE_STATE
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    static PY_INT64_T main_interpreter_id = -1;
#if CYTHON_COMPILING_IN_GRAAL
    PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x03090000
    PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
#elif CYTHON_COMPILING_IN_LIMITED_API
    PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
#else
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
#endif
    if (unlikely(current_id == -1)) {
        return -1;
    }
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return 0;
    } else if (unlikely(main_interpreter_id != current_id)) {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#endif
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    #if !CYTHON_USE_MODULE_STATE
    if (__Pyx_check_single_interpreter())
        return NULL;
    #endif
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_pywrapfst(PyObject *__pyx_pyinit_module)
#endif
{
  int stringtab_initialized = 0;
  #if CYTHON_USE_MODULE_STATE
  int pystate_addmodule_run = 0;
  #endif
  __pyx_mstatetype *__pyx_mstate = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  size_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'pywrapfst' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #else
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_t_1 = __pyx_pyinit_module;
  Py_INCREF(__pyx_t_1);
  #else
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #if CYTHON_USE_MODULE_STATE
  {
    int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
    __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "pywrapfst" pseudovariable */
    if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    pystate_addmodule_run = 1;
  }
  #else
  __pyx_m = __pyx_t_1;
  #endif
  #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  #endif
  __pyx_mstate = __pyx_mstate_global;
  CYTHON_UNUSED_VAR(__pyx_t_1);
  __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_mstate->__pyx_d);
  __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /* ImportRefnannyAPI */
  #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("PyInit_pywrapfst", 0);
  if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  stringtab_initialized = 1;
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__pyx_module_is_main_pywrapfst) {
    if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  {
    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)
    }
  }
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_CreateCodeObjects(__pyx_mstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  if (unlikely((__Pyx_modinit_function_export_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely((__Pyx_modinit_type_init_code(__pyx_mstate) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code(__pyx_mstate);
  (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  /*--- Execution code ---*/

  /* "pywrapfst.pyx":97
 * 
 * # Python imports.
 * import logging             # <<<<<<<<<<<<<<
 * import enum
 * import numbers
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_logging, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_logging, __pyx_t_2) < 0) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":98
 * # Python imports.
 * import logging
 * import enum             # <<<<<<<<<<<<<<
 * import numbers
 * import os
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_enum, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_enum, __pyx_t_2) < 0) __PYX_ERR(0, 98, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":99
 * import logging
 * import enum
 * import numbers             # <<<<<<<<<<<<<<
 * import os
 * import subprocess
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_numbers, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_numbers, __pyx_t_2) < 0) __PYX_ERR(0, 99, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":100
 * import enum
 * import numbers
 * import os             # <<<<<<<<<<<<<<
 * import subprocess
 * import sys
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_os, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_os, __pyx_t_2) < 0) __PYX_ERR(0, 100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":101
 * import numbers
 * import os
 * import subprocess             # <<<<<<<<<<<<<<
 * import sys
 * 
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_subprocess, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_subprocess, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":102
 * import os
 * import subprocess
 * import sys             # <<<<<<<<<<<<<<
 * 
 * # copybara:strip_begin
*/
  __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_sys, __pyx_t_2) < 0) __PYX_ERR(0, 102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":106
 * # copybara:strip_begin
 * # This only works, and is only needed, inside of Colab.
 * try:             # <<<<<<<<<<<<<<
 *   from colabtools import frontend
 *   from colabtools import stubby
*/
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "pywrapfst.pyx":107
 * # This only works, and is only needed, inside of Colab.
 * try:
 *   from colabtools import frontend             # <<<<<<<<<<<<<<
 *   from colabtools import stubby
 *   from google3.visualization.graphviz_server.proto import graphviz_server_pb2
*/
      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_frontend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_colabtools, __pyx_t_2, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 107, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_frontend); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_frontend, __pyx_t_2) < 0) __PYX_ERR(0, 107, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pywrapfst.pyx":108
 * try:
 *   from colabtools import frontend
 *   from colabtools import stubby             # <<<<<<<<<<<<<<
 *   from google3.visualization.graphviz_server.proto import graphviz_server_pb2
 * except ImportError:
*/
      __pyx_t_5 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_stubby); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_colabtools, __pyx_t_5, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 108, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_stubby); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 108, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_stubby, __pyx_t_5) < 0) __PYX_ERR(0, 108, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "pywrapfst.pyx":109
 *   from colabtools import frontend
 *   from colabtools import stubby
 *   from google3.visualization.graphviz_server.proto import graphviz_server_pb2             # <<<<<<<<<<<<<<
 * except ImportError:
 *   pass
*/
      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_graphviz_server_pb2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_google3_visualization_graphviz_s, __pyx_t_2, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 109, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_graphviz_server_pb2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 109, __pyx_L2_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_graphviz_server_pb2, __pyx_t_2) < 0) __PYX_ERR(0, 109, __pyx_L2_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "pywrapfst.pyx":106
 * # copybara:strip_begin
 * # This only works, and is only needed, inside of Colab.
 * try:             # <<<<<<<<<<<<<<
 *   from colabtools import frontend
 *   from colabtools import stubby
*/
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L7_try_end;
    __pyx_L2_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pywrapfst.pyx":110
 *   from colabtools import stubby
 *   from google3.visualization.graphviz_server.proto import graphviz_server_pb2
 * except ImportError:             # <<<<<<<<<<<<<<
 *   pass
 * # copybara:strip_end
*/
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ImportError);
    if (__pyx_t_6) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L3_exception_handled;
    }
    goto __pyx_L4_except_error;

    /* "pywrapfst.pyx":106
 * # copybara:strip_begin
 * # This only works, and is only needed, inside of Colab.
 * try:             # <<<<<<<<<<<<<<
 *   from colabtools import frontend
 *   from colabtools import stubby
*/
    __pyx_L4_except_error:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L3_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_3, __pyx_t_4);
    __pyx_L7_try_end:;
  }

  /* "pywrapfst.pyx":119
 * # These defintions only ensure that these are defined to avoid attribute errors,
 * # but don't actually contain the type definitions. Those are in pywrapfst.pyi.
 * import typing             # <<<<<<<<<<<<<<
 * 
 * ArcMapType = """typing.Literal["identity", "input_epsilon", "invert",
*/
  __pyx_t_5 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_typing, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_typing, __pyx_t_5) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":121
 * import typing
 * 
 * ArcMapType = """typing.Literal["identity", "input_epsilon", "invert",             # <<<<<<<<<<<<<<
 *                                "output_epsilon", "plus", "power", "quantize",
 *                                "rmweight", "superfinal", "times", "to_log",
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ArcMapType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_identity_input_ep) < 0) __PYX_ERR(0, 121, __pyx_L1_error)

  /* "pywrapfst.pyx":126
 *                                # NOTE: Both spellings of "to_std"
 *                                "to_log64", "to_std", "to_standard"]"""
 * ClosureType = """Literal["star", "plus"]"""             # <<<<<<<<<<<<<<
 * ComposeFilter = """typing.Literal["alt_sequence", "auto", "match", "no_match",
 *                            "null", "sequence", "trivial"]"""
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ClosureType, __pyx_mstate_global->__pyx_kp_u_Literal_star_plus) < 0) __PYX_ERR(0, 126, __pyx_L1_error)

  /* "pywrapfst.pyx":127
 *                                "to_log64", "to_std", "to_standard"]"""
 * ClosureType = """Literal["star", "plus"]"""
 * ComposeFilter = """typing.Literal["alt_sequence", "auto", "match", "no_match",             # <<<<<<<<<<<<<<
 *                            "null", "sequence", "trivial"]"""
 * DeterminizeType = """typing.Literal["functional", "nonfunctional",
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ComposeFilter, __pyx_mstate_global->__pyx_kp_u_typing_Literal_alt_sequence_auto) < 0) __PYX_ERR(0, 127, __pyx_L1_error)

  /* "pywrapfst.pyx":129
 * ComposeFilter = """typing.Literal["alt_sequence", "auto", "match", "no_match",
 *                            "null", "sequence", "trivial"]"""
 * DeterminizeType = """typing.Literal["functional", "nonfunctional",             # <<<<<<<<<<<<<<
 *                                     "disambiguate"]"""
 * DrawFloatFormat = """typing.Literal["e", "f", "g"]"""
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DeterminizeType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_functional_nonfun) < 0) __PYX_ERR(0, 129, __pyx_L1_error)

  /* "pywrapfst.pyx":131
 * DeterminizeType = """typing.Literal["functional", "nonfunctional",
 *                                     "disambiguate"]"""
 * DrawFloatFormat = """typing.Literal["e", "f", "g"]"""             # <<<<<<<<<<<<<<
 * EpsNormalizeType = """typing.Literal["input", "output"]"""
 * FarType = """typing.Literal[
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_DrawFloatFormat, __pyx_mstate_global->__pyx_kp_u_typing_Literal_e_f_g) < 0) __PYX_ERR(0, 131, __pyx_L1_error)

  /* "pywrapfst.pyx":132
 *                                     "disambiguate"]"""
 * DrawFloatFormat = """typing.Literal["e", "f", "g"]"""
 * EpsNormalizeType = """typing.Literal["input", "output"]"""             # <<<<<<<<<<<<<<
 * FarType = """typing.Literal[
 *   "fst",
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_EpsNormalizeType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_input_output) < 0) __PYX_ERR(0, 132, __pyx_L1_error)

  /* "pywrapfst.pyx":133
 * DrawFloatFormat = """typing.Literal["e", "f", "g"]"""
 * EpsNormalizeType = """typing.Literal["input", "output"]"""
 * FarType = """typing.Literal[             # <<<<<<<<<<<<<<
 *   "fst",
 *   "stlist",
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FarType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_fst_stlist_sttabl) < 0) __PYX_ERR(0, 133, __pyx_L1_error)

  /* "pywrapfst.pyx":142
 *   "default"
 * ]"""
 * ProjectType = """typing.Literal["input", "output"]"""             # <<<<<<<<<<<<<<
 * QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state",
 *                               "top"]"""
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ProjectType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_input_output) < 0) __PYX_ERR(0, 142, __pyx_L1_error)

  /* "pywrapfst.pyx":143
 * ]"""
 * ProjectType = """typing.Literal["input", "output"]"""
 * QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state",             # <<<<<<<<<<<<<<
 *                               "top"]"""
 * RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_QueueType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_auto_fifo_lifo_sh) < 0) __PYX_ERR(0, 143, __pyx_L1_error)

  /* "pywrapfst.pyx":145
 * QueueType = """typing.Literal["auto", "fifo", "lifo", "shortest", "state",
 *                               "top"]"""
 * RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""             # <<<<<<<<<<<<<<
 * ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
 * ReweightType = """typing.Literal["to_initial", "to_final"]"""
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_RandArcSelection, __pyx_mstate_global->__pyx_kp_u_typing_Literal_uniform_log_prob) < 0) __PYX_ERR(0, 145, __pyx_L1_error)

  /* "pywrapfst.pyx":146
 *                               "top"]"""
 * RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
 * ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""             # <<<<<<<<<<<<<<
 * ReweightType = """typing.Literal["to_initial", "to_final"]"""
 * SortType = """typing.Literal["ilabel", "olabel"]"""
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReplaceLabelType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_neither_input_out) < 0) __PYX_ERR(0, 146, __pyx_L1_error)

  /* "pywrapfst.pyx":147
 * RandArcSelection = """typing.Literal["uniform", "log_prob", "fast_log_prob"]"""
 * ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
 * ReweightType = """typing.Literal["to_initial", "to_final"]"""             # <<<<<<<<<<<<<<
 * SortType = """typing.Literal["ilabel", "olabel"]"""
 * StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ReweightType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_to_initial_to_fin) < 0) __PYX_ERR(0, 147, __pyx_L1_error)

  /* "pywrapfst.pyx":148
 * ReplaceLabelType = """typing.Literal["neither", "input", "output", "both"]"""
 * ReweightType = """typing.Literal["to_initial", "to_final"]"""
 * SortType = """typing.Literal["ilabel", "olabel"]"""             # <<<<<<<<<<<<<<
 * StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
 * 
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_SortType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_ilabel_olabel) < 0) __PYX_ERR(0, 148, __pyx_L1_error)

  /* "pywrapfst.pyx":149
 * ReweightType = """typing.Literal["to_initial", "to_final"]"""
 * SortType = """typing.Literal["ilabel", "olabel"]"""
 * StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""             # <<<<<<<<<<<<<<
 * 
 * WeightLike = "typing.Union[Weight, typing.Union[str, int, float]]"
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_StateMapType, __pyx_mstate_global->__pyx_kp_u_typing_Literal_arc_sum_arc_uniqu) < 0) __PYX_ERR(0, 149, __pyx_L1_error)

  /* "pywrapfst.pyx":151
 * StateMapType = """typing.Literal["arc_sum", "arc_unique", "identity"]"""
 * 
 * WeightLike = "typing.Union[Weight, typing.Union[str, int, float]]"             # <<<<<<<<<<<<<<
 * 
 * ## Custom exceptions.
*/
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_WeightLike, __pyx_mstate_global->__pyx_kp_u_typing_Union_Weight_typing_Union) < 0) __PYX_ERR(0, 151, __pyx_L1_error)

  /* "pywrapfst.pyx":156
 * 
 * 
 * class FstError(Exception):             # <<<<<<<<<<<<<<
 * 
 *   pass
*/
  __pyx_t_5 = PyTuple_Pack(1, ((PyObject *)(((PyTypeObject*)PyExc_Exception)))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstError, __pyx_mstate_global->__pyx_n_u_FstError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_2 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 156, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_FstError, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FstError, __pyx_t_5) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":161
 * 
 * 
 * class FstArgError(FstError, ValueError):             # <<<<<<<<<<<<<<
 * 
 *   pass
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_Pack(2, __pyx_t_2, __pyx_builtin_ValueError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstArgError, __pyx_mstate_global->__pyx_n_u_FstArgError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_2 != __pyx_t_7) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 161, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FstArgError, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FstArgError, __pyx_t_7) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":166
 * 
 * 
 * class FstBadWeightError(FstError, ValueError):             # <<<<<<<<<<<<<<
 * 
 *   pass
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyTuple_Pack(2, __pyx_t_2, __pyx_builtin_ValueError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstBadWeightError, __pyx_mstate_global->__pyx_n_u_FstBadWeightError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_2 != __pyx_t_8) {
    if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 166, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstBadWeightError, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FstBadWeightError, __pyx_t_8) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":171
 * 
 * 
 * class FstIndexError(FstError, IndexError):             # <<<<<<<<<<<<<<
 * 
 *   pass
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_Pack(2, __pyx_t_2, __pyx_builtin_IndexError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstIndexError, __pyx_mstate_global->__pyx_n_u_FstIndexError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_2 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 171, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_FstIndexError, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FstIndexError, __pyx_t_5) < 0) __PYX_ERR(0, 171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":176
 * 
 * 
 * class FstIOError(FstError, IOError):             # <<<<<<<<<<<<<<
 * 
 *   pass
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_Pack(2, __pyx_t_2, __pyx_builtin_IOError); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstIOError, __pyx_mstate_global->__pyx_n_u_FstIOError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_2 != __pyx_t_7) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 176, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_FstIOError, __pyx_t_2, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FstIOError, __pyx_t_7) < 0) __PYX_ERR(0, 176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":181
 * 
 * 
 * class FstOpError(FstError, RuntimeError):             # <<<<<<<<<<<<<<
 * 
 *   pass
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyTuple_Pack(2, __pyx_t_2, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_FstOpError, __pyx_mstate_global->__pyx_n_u_FstOpError, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_2 != __pyx_t_8) {
    if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 181, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstOpError, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FstOpError, __pyx_t_8) < 0) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":513
 *     self._check_weight()
 * 
 *   cpdef Weight copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_3copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight_copy, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_2) < 0) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":523
 *     return _weight
 * 
 *   cpdef string type(self):             # <<<<<<<<<<<<<<
 *     """type(self)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_5type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_type, __pyx_t_2) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":530
 *     return self._weight.get().Type()
 * 
 *   cpdef string to_string(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().ToString()
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_7to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight_to_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_to_string, __pyx_t_2) < 0) __PYX_ERR(0, 530, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":545
 *     return float(self.to_string())
 * 
 *   cpdef bool member(self):             # <<<<<<<<<<<<<<
 *     return self._weight.get().Member()
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_15member, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight_member, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_member, __pyx_t_2) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":548
 *     return self._weight.get().Member()
 * 
 *   def properties(self):             # <<<<<<<<<<<<<<
 *     """properties(self)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_17properties, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight_properties, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_properties, __pyx_t_2) < 0) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":570
 *   # C++ part out-of-class and then call it from within.
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def zero(cls, weight_type):
 *     """
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_23zero, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight_zero, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_zero, __pyx_t_2) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_zero); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_zero, __pyx_t_5) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":579
 *     return _zero(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def one(cls, weight_type):
 *     """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_25one, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight_one, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_one, __pyx_t_5) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_one); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_one, __pyx_t_2) < 0) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":588
 *     return _one(weight_type)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def no_weight(cls, weight_type):
 *     """
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_27no_weight, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight_no_weight, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_no_weight, __pyx_t_2) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_no_weight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Weight, __pyx_mstate_global->__pyx_n_u_no_weight, __pyx_t_5) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(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):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_29__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(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"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_6Weight_31__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Weight___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":605
 * 
 * 
 * def plus(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   plus(lhs, rhs)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_1plus, 0, __pyx_mstate_global->__pyx_n_u_plus, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_plus, __pyx_t_5) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":637
 * 
 * 
 * def times(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   times(lhs, rhs)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3times, 0, __pyx_mstate_global->__pyx_n_u_times, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[11])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_times, __pyx_t_5) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":669
 * 
 * 
 * def divide(Weight lhs, Weight rhs):             # <<<<<<<<<<<<<<
 *   """
 *   divide(lhs, rhs)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_5divide, 0, __pyx_mstate_global->__pyx_n_u_divide, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[12])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_divide, __pyx_t_5) < 0) __PYX_ERR(0, 669, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":702
 * 
 * 
 * def power(Weight w, size_t n):             # <<<<<<<<<<<<<<
 *   """
 *   power(lhs, rhs)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_7power, 0, __pyx_mstate_global->__pyx_n_u_power, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[13])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_power, __pyx_t_5) < 0) __PYX_ERR(0, 702, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":844
 *   # Registers the class for pickling.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return (_read_SymbolTable_from_string, (self.write_to_string(),))
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[14])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_5) < 0) __PYX_ERR(0, 844, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":866
 *     return _raw
 * 
 *   cpdef int64_t available_key(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     available_key(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_7available_key, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_available_key, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[15])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_available_key, __pyx_t_5) < 0) __PYX_ERR(0, 866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":874
 *     return self._raw_ptr_or_raise().AvailableKey()
 * 
 *   cpdef bytes checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     checksum(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_9checksum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_checksum, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[16])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_checksum, __pyx_t_5) < 0) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":882
 *     return self._raw_ptr_or_raise().CheckSum()
 * 
 *   cpdef SymbolTable copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_11copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_copy, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[17])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_5) < 0) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":890
 *     return _init_SymbolTable(WrapUnique(self._raw_ptr_or_raise().Copy()))
 * 
 *   def find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_13find, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_find, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[18])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_find, __pyx_t_5) < 0) __PYX_ERR(0, 890, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":913
 *       return _raw.FindSymbol(key)
 * 
 *   cpdef int64_t get_nth_key(self, ssize_t pos) except *:             # <<<<<<<<<<<<<<
 *     """
 *     get_nth_key(self, pos)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_15get_nth_key, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_get_nth_key, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[19])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_get_nth_key, __pyx_t_5) < 0) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":927
 *     return self._raw_ptr_or_raise().GetNthKey(pos)
 * 
 *   cpdef bytes labeled_checksum(self):             # <<<<<<<<<<<<<<
 *     """
 *     labeled_checksum(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_17labeled_checksum, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_labeled_checksum, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[20])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_labeled_checksum, __pyx_t_5) < 0) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":935
 *     return self._raw_ptr_or_raise().LabeledCheckSum()
 * 
 *   cpdef bool member(self, key) except *:             # <<<<<<<<<<<<<<
 *     """
 *     member(self, key)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_19member, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_member, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[21])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_member, __pyx_t_5) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":957
 *       return _raw.MemberIndex(key)
 * 
 *   cpdef string name(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     name(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_21name, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_name, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[22])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_t_5) < 0) __PYX_ERR(0, 957, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":965
 *     return self._raw_ptr_or_raise().Name()
 * 
 *   cpdef size_t num_symbols(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_symbols(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_23num_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_num_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[23])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_num_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":973
 *     return self._raw_ptr_or_raise().NumSymbols()
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, source)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_25write, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_write, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[24])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_write, __pyx_t_5) < 0) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":995
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   def write_text(self, source, *, sep="\t "):             # <<<<<<<<<<<<<<
 *     """
 *     write_text(self, source, *, sep="\t ")
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sep, __pyx_mstate_global->__pyx_kp_u__4) < 0) __PYX_ERR(0, 995, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_27write_text, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_write_text, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[25])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_write_text, __pyx_t_2) < 0) __PYX_ERR(0, 995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1020
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *     """
 *     write_to_string(self)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15SymbolTableView_29write_to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableView_write_to_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[26])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTableView, __pyx_mstate_global->__pyx_n_u_write_to_string, __pyx_t_2) < 0) __PYX_ERR(0, 1020, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1118
 *     return mutable_raw
 * 
 *   cpdef int64_t add_symbol(self, symbol, int64_t key=fst.kNoSymbol) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_symbol(self, symbol, key=NO_SYMBOL)
*/
  __pyx_mstate_global->__pyx_k__5 = fst::kNoSymbol;
  __pyx_t_2 = __Pyx_PyLong_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableSymbolTable_1add_symbol, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableSymbolTable_add_symbol, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[27])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1118, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable, __pyx_mstate_global->__pyx_n_u_add_symbol, __pyx_t_2) < 0) __PYX_ERR(0, 1118, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1146
 *     return _index
 * 
 *   cpdef void add_table(self, SymbolTableView symbols) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add_table(self, symbols)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableSymbolTable_3add_table, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableSymbolTable_add_table, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[28])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable, __pyx_mstate_global->__pyx_n_u_add_table, __pyx_t_2) < 0) __PYX_ERR(0, 1146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1163
 *       _sym1.AddTable(deref(_sym2))
 * 
 *   cpdef void set_name(self, new_name) except *:             # <<<<<<<<<<<<<<
 *     cdef SymbolTable_ptr _mutable_raw = self._mutable_raw_ptr_or_raise()
 *     cdef string _new_name = tostring(new_name)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableSymbolTable_5set_name, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableSymbolTable_set_name, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[29])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableSymbolTable, __pyx_mstate_global->__pyx_n_u_set_name, __pyx_t_2) < 0) __PYX_ERR(0, 1163, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1211
 *     return self._smart_table.get()
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_11SymbolTable_5read, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTable_read, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[30])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_2) < 0) __PYX_ERR(0, 1211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_5) < 0) __PYX_ERR(0, 1211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1234
 *     return _init_SymbolTable(move(_symbols))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_text(cls, source, *, sep="\t "):
 *     """
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_sep, __pyx_mstate_global->__pyx_kp_u__4) < 0) __PYX_ERR(0, 1234, __pyx_L1_error)
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_11SymbolTable_7read_text, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTable_read_text, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[31])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsKwDict(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read_text, __pyx_t_2) < 0) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read_text); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read_text, __pyx_t_5) < 0) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1260
 *     return _init_SymbolTable(move(_symbols))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_fst(cls, source, bool input_table):
 *     """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_11SymbolTable_9read_fst, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTable_read_fst, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[32])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read_fst, __pyx_t_5) < 0) __PYX_ERR(0, 1260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read_fst); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_SymbolTable, __pyx_mstate_global->__pyx_n_u_read_fst, __pyx_t_2) < 0) __PYX_ERR(0, 1260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1324
 * 
 * 
 * cpdef SymbolTable _read_SymbolTable_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9_read_SymbolTable_from_string, 0, __pyx_mstate_global->__pyx_n_u_read_SymbolTable_from_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[33])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_SymbolTable_from_string, __pyx_t_2) < 0) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1338
 * 
 * 
 * cpdef SymbolTable compact_symbol_table(SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *   """
 *   compact_symbol_table(symbols)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_11compact_symbol_table, 0, __pyx_mstate_global->__pyx_n_u_compact_symbol_table, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[34])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compact_symbol_table, __pyx_t_2) < 0) __PYX_ERR(0, 1338, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1357
 * 
 * 
 * cpdef SymbolTable merge_symbol_table(SymbolTableView lhs,             # <<<<<<<<<<<<<<
 *                                      SymbolTableView rhs):
 *   """
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_13merge_symbol_table, 0, __pyx_mstate_global->__pyx_n_u_merge_symbol_table, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[35])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_merge_symbol_table, __pyx_t_2) < 0) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_20_SymbolTableIterator_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableIterator___reduce_cy, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[36])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._it cannot be converted to a Python object for pickling"
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_20_SymbolTableIterator_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_SymbolTableIterator___setstate, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[37])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1481
 *   # Registers the class for pickling.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *       return _read_EncodeMapper_from_string, (self.write_to_string(),)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_7__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[38])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_2) < 0) __PYX_ERR(0, 1481, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1484
 *       return _read_EncodeMapper_from_string, (self.write_to_string(),)
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_9arc_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_arc_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[39])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_arc_type, __pyx_t_2) < 0) __PYX_ERR(0, 1484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1495
 *     return _string
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_11weight_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_weight_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[40])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_weight_type, __pyx_t_2) < 0) __PYX_ERR(0, 1495, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1506
 *     return _string
 * 
 *   def flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_13flags, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_flags, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[41])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_flags, __pyx_t_2) < 0) __PYX_ERR(0, 1506, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1526
 *     return _props
 * 
 *   def properties(self, mask):             # <<<<<<<<<<<<<<
 *     """properties(self, mask)
 * 
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_15properties, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_properties, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[42])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_properties, __pyx_t_2) < 0) __PYX_ERR(0, 1526, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":1537
 *     return FstProperties(self._properties(_mask))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_17read, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_read, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[43])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_2) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetNameInClass(__pyx_t_2, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_5) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1561
 *     return _init_EncodeMapper(_mapper.release())
 * 
 *   @staticmethod             # <<<<<<<<<<<<<<
 *   def read_from_string(state):
 *     """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_19read_from_string, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_read_from_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[44])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_read_from_string, __pyx_t_5) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = NULL;
  __Pyx_INCREF(__pyx_builtin_staticmethod);
  __pyx_t_7 = __pyx_builtin_staticmethod; 
  __Pyx_GetNameInClass(__pyx_t_8, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_read_from_string); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = 1;
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
    __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+__pyx_t_9, (2-__pyx_t_9) | (__pyx_t_9*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
  }
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_read_from_string, __pyx_t_5) < 0) __PYX_ERR(0, 1561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1579
 *     return _read_EncodeMapper_from_string(state)
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *       """
 *       write(self, source)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_21write, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_write, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[45])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_write, __pyx_t_5) < 0) __PYX_ERR(0, 1579, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1599
 *         raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *       """
 *       write_to_string(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_23write_to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_write_to_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[46])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_write_to_string, __pyx_t_5) < 0) __PYX_ERR(0, 1599, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1619
 *       return _sstrm.str()
 * 
 *   cpdef _EncodeMapperSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_25input_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_input_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[47])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_input_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 1619, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1629
 *     return _init_EncodeMapperSymbolTableView(self._mapper, input_side=True)
 * 
 *   cpdef _EncodeMapperSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_27output_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_output_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[48])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_output_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 1629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1646
 *       self._mapper.get().SetInputSymbols(ptr)
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_29set_input_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_set_input_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[49])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_set_input_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 1646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1670
 *       self._mapper.get().SetOutputSymbols(ptr)
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12EncodeMapper_31set_output_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_EncodeMapper_set_output_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[50])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_EncodeMapper, __pyx_mstate_global->__pyx_n_u_set_output_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 1670, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1694
 * 
 * 
 * cpdef EncodeMapper _read_EncodeMapper_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_15_read_EncodeMapper_from_string, 0, __pyx_mstate_global->__pyx_n_u_read_EncodeMapper_from_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[51])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_EncodeMapper_from_string, __pyx_t_5) < 0) __PYX_ERR(0, 1694, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1750
 *     return proc.communicate(dot.encode("utf8"))[0]
 * 
 *   def _repr_svg_(self):             # <<<<<<<<<<<<<<
 *     """IPython notebook magic to produce an SVG of the FST using GraphViz.
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_1_repr_svg_, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst__repr_svg, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[52])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_repr_svg, __pyx_t_5) < 0) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1798
 *   # can't be derived by _init_XFst.
 * 
 *   def __reduce__(self):             # <<<<<<<<<<<<<<
 *     return _read_Fst_from_string, (self.write_to_string(),)
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_5__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst___reduce, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[53])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_reduce, __pyx_t_5) < 0) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1807
 *     return self.print()
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_11arc_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_arc_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[54])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_arc_type, __pyx_t_5) < 0) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1818
 *     return _string
 * 
 *   cpdef _ArcIterator arcs(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     arcs(self, state)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_13arcs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_arcs, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[55])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_arcs, __pyx_t_5) < 0) __PYX_ERR(0, 1818, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1832
 *     return _ArcIterator(self, state)
 * 
 *   cpdef Fst copy(self):             # <<<<<<<<<<<<<<
 *     """
 *     copy(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_15copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_copy, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[56])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_5) < 0) __PYX_ERR(0, 1832, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1840
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_17draw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_draw, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[57])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[0]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_draw, __pyx_t_5) < 0) __PYX_ERR(0, 1840, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1927
 *                _source)
 * 
 *   cpdef Weight final(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     final(self, state)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_19final, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_final, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[58])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_final, __pyx_t_5) < 0) __PYX_ERR(0, 1927, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1948
 *     return _weight
 * 
 *   cpdef string fst_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     fst_type(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_21fst_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_fst_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[59])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_fst_type, __pyx_t_5) < 0) __PYX_ERR(0, 1948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1959
 *     return _string
 * 
 *   cpdef _FstSymbolTableView input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     input_symbols(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_23input_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_input_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[60])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_input_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 1959, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1969
 *     return _init_FstSymbolTableView(self._fst, input_side=True)
 * 
 *   def num_states_if_known(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_states_if_known(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_25num_states_if_known, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_num_states_if_known, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[61])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_num_states_if_known, __pyx_t_5) < 0) __PYX_ERR(0, 1969, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":1978
 *     return result.value() if result.has_value() else None
 * 
 *   cpdef size_t num_arcs(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_arcs(self, state)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_27num_arcs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_num_arcs, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[62])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_num_arcs, __pyx_t_5) < 0) __PYX_ERR(0, 1978, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2000
 *     return _size
 * 
 *   cpdef size_t num_input_epsilons(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_input_epsilons(self, state)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_29num_input_epsilons, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_num_input_epsilons, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[63])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_num_input_epsilons, __pyx_t_5) < 0) __PYX_ERR(0, 2000, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2022
 *     return _size
 * 
 *   cpdef size_t num_output_epsilons(self, int64_t state) except *:             # <<<<<<<<<<<<<<
 *     """
 *     num_output_epsilons(self, state)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_31num_output_epsilons, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_num_output_epsilons, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[64])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_num_output_epsilons, __pyx_t_5) < 0) __PYX_ERR(0, 2022, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2044
 *     return _size
 * 
 *   cpdef _FstSymbolTableView output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     output_symbols(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_33output_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_output_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[65])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2044, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_output_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 2044, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2054
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_35print, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_print, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[66])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[1]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_print, __pyx_t_5) < 0) __PYX_ERR(0, 2054, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2109
 *     return _props
 * 
 *   def properties(self, mask, bool test):             # <<<<<<<<<<<<<<
 *     """properties(self, mask)
 * 
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_37properties, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_properties, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[67])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_properties, __pyx_t_5) < 0) __PYX_ERR(0, 2109, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2120
 *     return FstProperties(self._properties(_mask, test))
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read(cls, source):
 *     """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_39read, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_read, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[68])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_5) < 0) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_read); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_read, __pyx_t_7) < 0) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2138
 *     return _read_Fst(source)
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def read_from_string(cls, state):
 *     """
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_41read_from_string, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_read_from_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[69])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_read_from_string, __pyx_t_7) < 0) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_read_from_string); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_read_from_string, __pyx_t_5) < 0) __PYX_ERR(0, 2138, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2156
 *     return _read_Fst_from_string(state)
 * 
 *   cpdef int64_t start(self):             # <<<<<<<<<<<<<<
 *     """
 *     start(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_43start, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_start, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[70])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_start, __pyx_t_5) < 0) __PYX_ERR(0, 2156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2165
 *       return self._fst.get().Start()
 * 
 *   cpdef _StateIterator states(self):             # <<<<<<<<<<<<<<
 *     """
 *     states(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_45states, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_states, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[71])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_states, __pyx_t_5) < 0) __PYX_ERR(0, 2165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2176
 *     return _StateIterator(self)
 * 
 *   cpdef bool verify(self):             # <<<<<<<<<<<<<<
 *     """
 *     verify(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_47verify, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_verify, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[72])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_verify, __pyx_t_5) < 0) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2188
 *       return fst.Verify(deref(self._fst))
 * 
 *   cpdef string weight_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     weight_type(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_49weight_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_weight_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[73])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_weight_type, __pyx_t_5) < 0) __PYX_ERR(0, 2188, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2200
 *       return self._fst.get().WeightType()
 * 
 *   cpdef void write(self, source) except *:             # <<<<<<<<<<<<<<
 *     """
 *     write(self, source)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_51write, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_write, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[74])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_write, __pyx_t_5) < 0) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2221
 *       raise FstIOError(f"Write failed: {source!r}")
 * 
 *   cpdef bytes write_to_string(self):             # <<<<<<<<<<<<<<
 *     """
 *     write_to_string(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Fst_53write_to_string, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Fst_write_to_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[75])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Fst, __pyx_mstate_global->__pyx_n_u_write_to_string, __pyx_t_5) < 0) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2271
 *       raise FstOpError("Incompatible or invalid weight type")
 * 
 *   def add_arc(self, int64_t state, Arc arc):             # <<<<<<<<<<<<<<
 *     """
 *     add_arc(self, state, arc)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_1add_arc, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_add_arc, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[76])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_add_arc, __pyx_t_5) < 0) __PYX_ERR(0, 2271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2291
 *     return self
 * 
 *   cpdef int64_t add_state(self):             # <<<<<<<<<<<<<<
 *     """
 *     add_state(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_3add_state, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_add_state, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[77])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_add_state, __pyx_t_5) < 0) __PYX_ERR(0, 2291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2305
 *     return _state
 * 
 *   cpdef void add_states(self, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     add_states(self, n)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_5add_states, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_add_states, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[78])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_add_states, __pyx_t_5) < 0) __PYX_ERR(0, 2305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2328
 *       fst.ArcSort(self._mfst.get(), _sort_type)
 * 
 *   def arcsort(self, sort_type="ilabel"):             # <<<<<<<<<<<<<<
 *     """
 *     arcsort(self, sort_type="ilabel")
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_7arcsort, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_arcsort, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[79])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[2]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_arcsort, __pyx_t_5) < 0) __PYX_ERR(0, 2328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2355
 *       fst.Closure(self._mfst.get(), _type)
 * 
 *   def closure(self, closure_type="star"):             # <<<<<<<<<<<<<<
 *     """
 *     closure(self, closure_type="star")
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_9closure, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_closure, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[80])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[3]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_closure, __pyx_t_5) < 0) __PYX_ERR(0, 2355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2383
 *     self._check_mutating_imethod()
 * 
 *   def concat(self, Fst fst2):             # <<<<<<<<<<<<<<
 *     """
 *     concat(self, fst2)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_11concat, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_concat, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[81])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_concat, __pyx_t_5) < 0) __PYX_ERR(0, 2383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2407
 *       fst.Connect(self._mfst.get())
 * 
 *   def connect(self):             # <<<<<<<<<<<<<<
 *     """
 *     connect(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_13connect, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_connect, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[82])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_connect, __pyx_t_5) < 0) __PYX_ERR(0, 2407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2427
 *     self._check_mutating_imethod()
 * 
 *   def decode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     decode(self, mapper)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_15decode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_decode, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[83])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_decode, __pyx_t_5) < 0) __PYX_ERR(0, 2427, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2456
 *     self._check_mutating_imethod()
 * 
 *   def delete_arcs(self, int64_t state, size_t n=0):             # <<<<<<<<<<<<<<
 *     """
 *     delete_arcs(self, state, n=0)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_17delete_arcs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_delete_arcs, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[84])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[4]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_delete_arcs, __pyx_t_5) < 0) __PYX_ERR(0, 2456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2494
 *     self._check_mutating_imethod()
 * 
 *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
 *     """
 *     delete_states(self, states=None)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_19delete_states, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_delete_states, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[85])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_delete_states, __pyx_t_5) < 0) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2518
 *     self._check_mutating_imethod()
 * 
 *   def encode(self, EncodeMapper mapper):             # <<<<<<<<<<<<<<
 *     """
 *     encode(self, mapper)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_21encode, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_encode, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[86])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_encode, __pyx_t_5) < 0) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2544
 *       fst.Invert(self._mfst.get())
 * 
 *   def invert(self):             # <<<<<<<<<<<<<<
 *     """
 *     invert(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_23invert, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_invert, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[87])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_invert, __pyx_t_5) < 0) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2560
 * 
 *   cdef void _minimize(self,
 *                       float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                       bool allow_nondet=False) except *:
 *     # This runs in-place when the second argument is null.
*/
  __pyx_mstate_global->__pyx_k__7 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2567
 *     self._check_mutating_imethod()
 * 
 *   def minimize(self, float delta=fst.kShortestDelta, bool allow_nondet=False):             # <<<<<<<<<<<<<<
 *     """
 *     minimize(self, delta=1e-6, allow_nondet=False)
*/
  __pyx_mstate_global->__pyx_k__8 = fst::kShortestDelta;
  __pyx_t_5 = PyFloat_FromDouble(fst::kShortestDelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = PyTuple_Pack(2, __pyx_t_5, Py_False); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_25minimize, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_minimize, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[88])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_minimize, __pyx_t_5) < 0) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2596
 *     return self
 * 
 *   cpdef _MutableArcIterator mutable_arcs(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_arcs(self, state)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_27mutable_arcs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_mutable_arcs, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[89])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_mutable_arcs, __pyx_t_5) < 0) __PYX_ERR(0, 2596, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2610
 *     return _MutableArcIterator(self, state)
 * 
 *   def mutable_input_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_input_symbols(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_29mutable_input_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_mutable_input_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[90])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_mutable_input_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 2610, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2620
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=True)
 * 
 *   def mutable_output_symbols(self):             # <<<<<<<<<<<<<<
 *     """
 *     mutable_output_symbols(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_31mutable_output_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_mutable_output_symbol, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[91])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_mutable_output_symbols, __pyx_t_5) < 0) __PYX_ERR(0, 2620, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2630
 *     return _init_MutableFstSymbolTableView(self._mfst, input_side=False)
 * 
 *   cpdef int64_t num_states(self):             # <<<<<<<<<<<<<<
 *     """
 *     num_states(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_33num_states, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_num_states, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[92])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_num_states, __pyx_t_5) < 0) __PYX_ERR(0, 2630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2646
 *       fst.Project(self._mfst.get(), _type)
 * 
 *   def project(self, project_type):             # <<<<<<<<<<<<<<
 *     """
 *     project(self, project_type)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_35project, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_project, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[93])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_project, __pyx_t_5) < 0) __PYX_ERR(0, 2646, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":2667
 * 
 *   cdef void _prune(self,
 *                    float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                    int64_t nstate=fst.kNoStateId,
 *                    weight=None) except *:
*/
  __pyx_mstate_global->__pyx_k__9 = fst::kDelta;

  /* "pywrapfst.pyx":2668
 *   cdef void _prune(self,
 *                    float delta=fst.kDelta,
 *                    int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                    weight=None) except *:
 *     # Threshold is set to semiring Zero (no pruning) if no weight is specified.
*/
  __pyx_mstate_global->__pyx_k__10 = fst::kNoStateId;

  /* "pywrapfst.pyx":2678
 * 
 *   def prune(self,
 *             float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *             int64_t nstate=fst.kNoStateId,
 *             weight=None):
*/
  __pyx_mstate_global->__pyx_k__11 = fst::kDelta;

  /* "pywrapfst.pyx":2679
 *   def prune(self,
 *             float delta=fst.kDelta,
 *             int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *             weight=None):
 *     """
*/
  __pyx_mstate_global->__pyx_k__12 = fst::kNoStateId;

  /* "pywrapfst.pyx":2678
 * 
 *   def prune(self,
 *             float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *             int64_t nstate=fst.kNoStateId,
 *             weight=None):
*/
  __pyx_t_5 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pywrapfst.pyx":2679
 *   def prune(self,
 *             float delta=fst.kDelta,
 *             int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *             weight=None):
 *     """
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pywrapfst.pyx":2677
 *     self._check_mutating_imethod()
 * 
 *   def prune(self,             # <<<<<<<<<<<<<<
 *             float delta=fst.kDelta,
 *             int64_t nstate=fst.kNoStateId,
*/
  __pyx_t_8 = PyTuple_Pack(3, __pyx_t_5, __pyx_t_7, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_37prune, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_prune, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[94])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_prune, __pyx_t_7) < 0) __PYX_ERR(0, 2677, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2704
 * 
 *   cdef void _push(self,
 *                   float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                   bool remove_total_weight=False,
 *                   reweight_type="to_initial"):
*/
  __pyx_mstate_global->__pyx_k__13 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2712
 * 
 *   def push(self,
 *            float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *            bool remove_total_weight=False,
 *            reweight_type="to_initial"):
*/
  __pyx_mstate_global->__pyx_k__14 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2711
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,
*/
  __pyx_t_7 = PyFloat_FromDouble(fst::kShortestDelta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pywrapfst.pyx":2713
 *   def push(self,
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *            reweight_type="to_initial"):
 *     """
*/
  __pyx_t_8 = PyTuple_Pack(3, __pyx_t_7, Py_False, __pyx_mstate_global->__pyx_n_u_to_initial); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2711
 *       fst.Push(self._mfst.get(), _type, delta, remove_total_weight)
 * 
 *   def push(self,             # <<<<<<<<<<<<<<
 *            float delta=fst.kShortestDelta,
 *            bool remove_total_weight=False,
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_39push, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_push, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[95])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_push, __pyx_t_7) < 0) __PYX_ERR(0, 2711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2758
 *     self._check_mutating_imethod()
 * 
 *   def relabel_pairs(self, ipairs=None, opairs=None):             # <<<<<<<<<<<<<<
 *     """
 *     relabel_pairs(self, ipairs=None, opairs=None)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_41relabel_pairs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_relabel_pairs, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[96])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[6]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_relabel_pairs, __pyx_t_7) < 0) __PYX_ERR(0, 2758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2818
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_43relabel_tables, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_relabel_tables, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[97])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[7]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_relabel_tables, __pyx_t_7) < 0) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2878
 *     self._check_mutating_imethod()
 * 
 *   def reserve_arcs(self, int64_t state, size_t n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_arcs(self, state, n)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_45reserve_arcs, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_reserve_arcs, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[98])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_reserve_arcs, __pyx_t_7) < 0) __PYX_ERR(0, 2878, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2901
 *       self._mfst.get().ReserveStates(n)
 * 
 *   def reserve_states(self, int64_t n):             # <<<<<<<<<<<<<<
 *     """
 *     reserve_states(self, n)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_47reserve_states, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_reserve_states, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[99])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_reserve_states, __pyx_t_7) < 0) __PYX_ERR(0, 2901, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2926
 *     self._check_mutating_imethod()
 * 
 *   def reweight(self, potentials, reweight_type="to_initial"):             # <<<<<<<<<<<<<<
 *     """
 *     reweight(self, potentials, reweight_type="to_initial")
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_49reweight, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_reweight, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[100])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[8]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_reweight, __pyx_t_7) < 0) __PYX_ERR(0, 2926, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":2956
 *                        bool connect=True,
 *                        weight=None,
 *                        int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kShortestDelta) except *:
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
*/
  __pyx_mstate_global->__pyx_k__15 = fst::kNoStateId;

  /* "pywrapfst.pyx":2957
 *                        weight=None,
 *                        int64_t nstate=fst.kNoStateId,
 *                        float delta=fst.kShortestDelta) except *:             # <<<<<<<<<<<<<<
 *     cdef fst.WeightClass _weight = _get_WeightClass_or_zero(self.weight_type(),
 *                                                             weight)
*/
  __pyx_mstate_global->__pyx_k__16 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2975
 *                 bool connect=True,
 *                 weight=None,
 *                 int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                 float delta=fst.kShortestDelta):
 *     """
*/
  __pyx_mstate_global->__pyx_k__17 = fst::kNoStateId;

  /* "pywrapfst.pyx":2976
 *                 weight=None,
 *                 int64_t nstate=fst.kNoStateId,
 *                 float delta=fst.kShortestDelta):             # <<<<<<<<<<<<<<
 *     """
 *     rmepsilon(self, queue_type="auto", connect=True, weight=None,
*/
  __pyx_mstate_global->__pyx_k__18 = fst::kShortestDelta;

  /* "pywrapfst.pyx":2975
 *                 bool connect=True,
 *                 weight=None,
 *                 int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                 float delta=fst.kShortestDelta):
 *     """
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pywrapfst.pyx":2976
 *                 weight=None,
 *                 int64_t nstate=fst.kNoStateId,
 *                 float delta=fst.kShortestDelta):             # <<<<<<<<<<<<<<
 *     """
 *     rmepsilon(self, queue_type="auto", connect=True, weight=None,
*/
  __pyx_t_8 = PyFloat_FromDouble(fst::kShortestDelta); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pywrapfst.pyx":2971
 *     self._check_mutating_imethod()
 * 
 *   def rmepsilon(self,             # <<<<<<<<<<<<<<
 *                 queue_type="auto",
 *                 bool connect=True,
*/
  __pyx_t_5 = PyTuple_Pack(5, __pyx_mstate_global->__pyx_n_u_auto, Py_True, Py_None, __pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_51rmepsilon, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_rmepsilon, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[101])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_rmepsilon, __pyx_t_8) < 0) __PYX_ERR(0, 2971, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3010
 *     self._check_mutating_imethod()
 * 
 *   def set_final(self, int64_t state, weight=None):             # <<<<<<<<<<<<<<
 *     """
 *     set_final(self, state, weight)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_53set_final, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_set_final, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[102])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[5]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_set_final, __pyx_t_8) < 0) __PYX_ERR(0, 3010, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3039
 *     self._mfst.get().SetInputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_input_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_input_symbols(self, symbols)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_55set_input_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_set_input_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[103])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_set_input_symbols, __pyx_t_8) < 0) __PYX_ERR(0, 3039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3062
 *     self._mfst.get().SetOutputSymbols(symbols._raw_ptr_or_raise())
 * 
 *   def set_output_symbols(self, SymbolTableView symbols):             # <<<<<<<<<<<<<<
 *     """
 *     set_output_symbols(self, symbols)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_57set_output_symbols, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_set_output_symbols, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[104])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_set_output_symbols, __pyx_t_8) < 0) __PYX_ERR(0, 3062, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3079
 *     return self
 * 
 *   def set_properties(self, props, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_properties(self, props, mask)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_59set_properties, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_set_properties, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[105])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_set_properties, __pyx_t_8) < 0) __PYX_ERR(0, 3079, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3106
 *       raise FstIndexError("State index out of range")
 * 
 *   def set_start(self, int64_t state):             # <<<<<<<<<<<<<<
 *     """
 *     set_start(self, state)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_61set_start, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_set_start, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[106])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_set_start, __pyx_t_8) < 0) __PYX_ERR(0, 3106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3131
 *       logging.warning("Cannot topsort cyclic FST")
 * 
 *   def topsort(self):             # <<<<<<<<<<<<<<
 *     """
 *     topsort(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_63topsort, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_topsort, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[107])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_topsort, __pyx_t_8) < 0) __PYX_ERR(0, 3131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3147
 *     return self
 * 
 *   def union(self, *fsts2):             # <<<<<<<<<<<<<<
 *     """
 *     union(self, *fsts2)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_10MutableFst_65union, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableFst_union, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[108])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_MutableFst, __pyx_mstate_global->__pyx_n_u_union, __pyx_t_8) < 0) __PYX_ERR(0, 3147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3238
 * 
 * 
 * cpdef Fst _read_Fst(source):             # <<<<<<<<<<<<<<
 *   cdef string _source = path_tostring(source)
 *   cdef unique_ptr[fst.FstClass] _tfst
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_17_read_Fst, 0, __pyx_mstate_global->__pyx_n_u_read_Fst, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[109])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_Fst, __pyx_t_8) < 0) __PYX_ERR(0, 3238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3248
 * 
 * 
 * cpdef Fst _read_Fst_from_string(string state):             # <<<<<<<<<<<<<<
 *   cdef stringstream _sstrm
 *   _sstrm << state
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_read_Fst_from_string, 0, __pyx_mstate_global->__pyx_n_u_read_Fst_from_string, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[110])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_read_Fst_from_string, __pyx_t_8) < 0) __PYX_ERR(0, 3248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3262
 * 
 * 
 * NO_LABEL = fst.kNoLabel             # <<<<<<<<<<<<<<
 * NO_STATE_ID = fst.kNoStateId
 * NO_SYMBOL = fst.kNoSymbol
*/
  __pyx_t_8 = __Pyx_PyLong_From_int(fst::kNoLabel); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NO_LABEL, __pyx_t_8) < 0) __PYX_ERR(0, 3262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3263
 * 
 * NO_LABEL = fst.kNoLabel
 * NO_STATE_ID = fst.kNoStateId             # <<<<<<<<<<<<<<
 * NO_SYMBOL = fst.kNoSymbol
 * 
*/
  __pyx_t_8 = __Pyx_PyLong_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NO_STATE_ID, __pyx_t_8) < 0) __PYX_ERR(0, 3263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3264
 * NO_LABEL = fst.kNoLabel
 * NO_STATE_ID = fst.kNoStateId
 * NO_SYMBOL = fst.kNoSymbol             # <<<<<<<<<<<<<<
 * 
 * 
*/
  __pyx_t_8 = __Pyx_PyLong_From_int64_t(fst::kNoSymbol); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_NO_SYMBOL, __pyx_t_8) < 0) __PYX_ERR(0, 3264, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3270
 * 
 * 
 * class FstProperties(enum.Flag):             # <<<<<<<<<<<<<<
 *   EXPANDED = fst.kExpanded
 *   MUTABLE = fst.kMutable
*/
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_enum); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_Flag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyTuple_Pack(1, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PEP560_update_bases(__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_FstProperties, __pyx_mstate_global->__pyx_n_u_FstProperties, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_5 != __pyx_t_8) {
    if (unlikely((PyDict_SetItemString(__pyx_t_2, "__orig_bases__", __pyx_t_8) < 0))) __PYX_ERR(0, 3270, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3271
 * 
 * class FstProperties(enum.Flag):
 *   EXPANDED = fst.kExpanded             # <<<<<<<<<<<<<<
 *   MUTABLE = fst.kMutable
 *   ERROR = fst.kError
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kExpanded); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_EXPANDED, __pyx_t_8) < 0) __PYX_ERR(0, 3271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3272
 * class FstProperties(enum.Flag):
 *   EXPANDED = fst.kExpanded
 *   MUTABLE = fst.kMutable             # <<<<<<<<<<<<<<
 *   ERROR = fst.kError
 *   ACCEPTOR = fst.kAcceptor
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kMutable); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3272, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_MUTABLE, __pyx_t_8) < 0) __PYX_ERR(0, 3272, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3273
 *   EXPANDED = fst.kExpanded
 *   MUTABLE = fst.kMutable
 *   ERROR = fst.kError             # <<<<<<<<<<<<<<
 *   ACCEPTOR = fst.kAcceptor
 *   NOT_ACCEPTOR = fst.kNotAcceptor
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kError); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ERROR, __pyx_t_8) < 0) __PYX_ERR(0, 3273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3274
 *   MUTABLE = fst.kMutable
 *   ERROR = fst.kError
 *   ACCEPTOR = fst.kAcceptor             # <<<<<<<<<<<<<<
 *   NOT_ACCEPTOR = fst.kNotAcceptor
 *   I_DETERMINISTIC = fst.kIDeterministic
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kAcceptor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ACCEPTOR, __pyx_t_8) < 0) __PYX_ERR(0, 3274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3275
 *   ERROR = fst.kError
 *   ACCEPTOR = fst.kAcceptor
 *   NOT_ACCEPTOR = fst.kNotAcceptor             # <<<<<<<<<<<<<<
 *   I_DETERMINISTIC = fst.kIDeterministic
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNotAcceptor); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NOT_ACCEPTOR, __pyx_t_8) < 0) __PYX_ERR(0, 3275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3276
 *   ACCEPTOR = fst.kAcceptor
 *   NOT_ACCEPTOR = fst.kNotAcceptor
 *   I_DETERMINISTIC = fst.kIDeterministic             # <<<<<<<<<<<<<<
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic
 *   O_DETERMINISTIC = fst.kODeterministic
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kIDeterministic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_I_DETERMINISTIC, __pyx_t_8) < 0) __PYX_ERR(0, 3276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3277
 *   NOT_ACCEPTOR = fst.kNotAcceptor
 *   I_DETERMINISTIC = fst.kIDeterministic
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic             # <<<<<<<<<<<<<<
 *   O_DETERMINISTIC = fst.kODeterministic
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNonIDeterministic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NON_I_DETERMINISTIC, __pyx_t_8) < 0) __PYX_ERR(0, 3277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3278
 *   I_DETERMINISTIC = fst.kIDeterministic
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic
 *   O_DETERMINISTIC = fst.kODeterministic             # <<<<<<<<<<<<<<
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic
 *   EPSILONS = fst.kEpsilons
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kODeterministic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_O_DETERMINISTIC, __pyx_t_8) < 0) __PYX_ERR(0, 3278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3279
 *   NON_I_DETERMINISTIC = fst.kNonIDeterministic
 *   O_DETERMINISTIC = fst.kODeterministic
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic             # <<<<<<<<<<<<<<
 *   EPSILONS = fst.kEpsilons
 *   NO_EPSILONS = fst.kNoEpsilons
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNonODeterministic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3279, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NON_O_DETERMINISTIC, __pyx_t_8) < 0) __PYX_ERR(0, 3279, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3280
 *   O_DETERMINISTIC = fst.kODeterministic
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic
 *   EPSILONS = fst.kEpsilons             # <<<<<<<<<<<<<<
 *   NO_EPSILONS = fst.kNoEpsilons
 *   I_EPSILONS = fst.kIEpsilons
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kEpsilons); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_EPSILONS, __pyx_t_8) < 0) __PYX_ERR(0, 3280, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3281
 *   NON_O_DETERMINISTIC = fst.kNonODeterministic
 *   EPSILONS = fst.kEpsilons
 *   NO_EPSILONS = fst.kNoEpsilons             # <<<<<<<<<<<<<<
 *   I_EPSILONS = fst.kIEpsilons
 *   NO_I_EPSILONS = fst.kNoIEpsilons
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNoEpsilons); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NO_EPSILONS, __pyx_t_8) < 0) __PYX_ERR(0, 3281, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3282
 *   EPSILONS = fst.kEpsilons
 *   NO_EPSILONS = fst.kNoEpsilons
 *   I_EPSILONS = fst.kIEpsilons             # <<<<<<<<<<<<<<
 *   NO_I_EPSILONS = fst.kNoIEpsilons
 *   O_EPSILONS = fst.kOEpsilons
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kIEpsilons); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_I_EPSILONS, __pyx_t_8) < 0) __PYX_ERR(0, 3282, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3283
 *   NO_EPSILONS = fst.kNoEpsilons
 *   I_EPSILONS = fst.kIEpsilons
 *   NO_I_EPSILONS = fst.kNoIEpsilons             # <<<<<<<<<<<<<<
 *   O_EPSILONS = fst.kOEpsilons
 *   NO_O_EPSILONS = fst.kNoOEpsilons
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNoIEpsilons); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NO_I_EPSILONS, __pyx_t_8) < 0) __PYX_ERR(0, 3283, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3284
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kOEpsilons); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_O_EPSILONS, __pyx_t_8) < 0) __PYX_ERR(0, 3284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3285
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kNoOEpsilons); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NO_O_EPSILONS, __pyx_t_8) < 0) __PYX_ERR(0, 3285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3286
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kILabelSorted); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_I_LABEL_SORTED, __pyx_t_8) < 0) __PYX_ERR(0, 3286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3287
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kNotILabelSorted); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NOT_I_LABEL_SORTED, __pyx_t_8) < 0) __PYX_ERR(0, 3287, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3288
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kOLabelSorted); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_O_LABEL_SORTED, __pyx_t_8) < 0) __PYX_ERR(0, 3288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3289
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kNotOLabelSorted); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NOT_O_LABEL_SORTED, __pyx_t_8) < 0) __PYX_ERR(0, 3289, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3290
 *   O_LABEL_SORTED = fst.kOLabelSorted
 *   NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
 *   WEIGHTED = fst.kWeighted             # <<<<<<<<<<<<<<
 *   UNWEIGHTED = fst.kUnweighted
 *   CYCLIC = fst.kCyclic
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kWeighted); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_WEIGHTED, __pyx_t_8) < 0) __PYX_ERR(0, 3290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3291
 *   NOT_O_LABEL_SORTED = fst.kNotOLabelSorted
 *   WEIGHTED = fst.kWeighted
 *   UNWEIGHTED = fst.kUnweighted             # <<<<<<<<<<<<<<
 *   CYCLIC = fst.kCyclic
 *   ACYCLIC = fst.kAcyclic
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kUnweighted); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UNWEIGHTED, __pyx_t_8) < 0) __PYX_ERR(0, 3291, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3292
 *   WEIGHTED = fst.kWeighted
 *   UNWEIGHTED = fst.kUnweighted
 *   CYCLIC = fst.kCyclic             # <<<<<<<<<<<<<<
 *   ACYCLIC = fst.kAcyclic
 *   INITIAL_CYCLIC = fst.kInitialCyclic
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kCyclic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_CYCLIC, __pyx_t_8) < 0) __PYX_ERR(0, 3292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3293
 *   UNWEIGHTED = fst.kUnweighted
 *   CYCLIC = fst.kCyclic
 *   ACYCLIC = fst.kAcyclic             # <<<<<<<<<<<<<<
 *   INITIAL_CYCLIC = fst.kInitialCyclic
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kAcyclic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ACYCLIC, __pyx_t_8) < 0) __PYX_ERR(0, 3293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3294
 *   CYCLIC = fst.kCyclic
 *   ACYCLIC = fst.kAcyclic
 *   INITIAL_CYCLIC = fst.kInitialCyclic             # <<<<<<<<<<<<<<
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic
 *   TOP_SORTED = fst.kTopSorted
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kInitialCyclic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_INITIAL_CYCLIC, __pyx_t_8) < 0) __PYX_ERR(0, 3294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3295
 *   ACYCLIC = fst.kAcyclic
 *   INITIAL_CYCLIC = fst.kInitialCyclic
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic             # <<<<<<<<<<<<<<
 *   TOP_SORTED = fst.kTopSorted
 *   NOT_TOP_SORTED = fst.kNotTopSorted
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kInitialAcyclic); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_INITIAL_ACYCLIC, __pyx_t_8) < 0) __PYX_ERR(0, 3295, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3296
 *   INITIAL_CYCLIC = fst.kInitialCyclic
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic
 *   TOP_SORTED = fst.kTopSorted             # <<<<<<<<<<<<<<
 *   NOT_TOP_SORTED = fst.kNotTopSorted
 *   ACCESSIBLE = fst.kAccessible
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kTopSorted); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TOP_SORTED, __pyx_t_8) < 0) __PYX_ERR(0, 3296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3297
 *   INITIAL_ACYCLIC = fst.kInitialAcyclic
 *   TOP_SORTED = fst.kTopSorted
 *   NOT_TOP_SORTED = fst.kNotTopSorted             # <<<<<<<<<<<<<<
 *   ACCESSIBLE = fst.kAccessible
 *   NOT_ACCESSIBLE = fst.kNotAccessible
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNotTopSorted); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NOT_TOP_SORTED, __pyx_t_8) < 0) __PYX_ERR(0, 3297, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3298
 *   TOP_SORTED = fst.kTopSorted
 *   NOT_TOP_SORTED = fst.kNotTopSorted
 *   ACCESSIBLE = fst.kAccessible             # <<<<<<<<<<<<<<
 *   NOT_ACCESSIBLE = fst.kNotAccessible
 *   COACCESSIBLE = fst.kCoAccessible
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kAccessible); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ACCESSIBLE, __pyx_t_8) < 0) __PYX_ERR(0, 3298, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3299
 *   NOT_TOP_SORTED = fst.kNotTopSorted
 *   ACCESSIBLE = fst.kAccessible
 *   NOT_ACCESSIBLE = fst.kNotAccessible             # <<<<<<<<<<<<<<
 *   COACCESSIBLE = fst.kCoAccessible
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNotAccessible); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NOT_ACCESSIBLE, __pyx_t_8) < 0) __PYX_ERR(0, 3299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3300
 *   ACCESSIBLE = fst.kAccessible
 *   NOT_ACCESSIBLE = fst.kNotAccessible
 *   COACCESSIBLE = fst.kCoAccessible             # <<<<<<<<<<<<<<
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible
 *   STRING = fst.kString
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kCoAccessible); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_COACCESSIBLE, __pyx_t_8) < 0) __PYX_ERR(0, 3300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3301
 *   NOT_ACCESSIBLE = fst.kNotAccessible
 *   COACCESSIBLE = fst.kCoAccessible
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible             # <<<<<<<<<<<<<<
 *   STRING = fst.kString
 *   NOT_STRING = fst.kNotString
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNotCoAccessible); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NOT_COACCESSIBLE, __pyx_t_8) < 0) __PYX_ERR(0, 3301, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3302
 *   COACCESSIBLE = fst.kCoAccessible
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible
 *   STRING = fst.kString             # <<<<<<<<<<<<<<
 *   NOT_STRING = fst.kNotString
 *   WEIGHTED_CYCLES = fst.kWeightedCycles
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kString); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_STRING, __pyx_t_8) < 0) __PYX_ERR(0, 3302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3303
 *   NOT_COACCESSIBLE = fst.kNotCoAccessible
 *   STRING = fst.kString
 *   NOT_STRING = fst.kNotString             # <<<<<<<<<<<<<<
 *   WEIGHTED_CYCLES = fst.kWeightedCycles
 *   UNWEIGHTED_CYCLES = fst.kUnweightedCycles
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNotString); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NOT_STRING, __pyx_t_8) < 0) __PYX_ERR(0, 3303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3304
 *   STRING = fst.kString
 *   NOT_STRING = fst.kNotString
 *   WEIGHTED_CYCLES = fst.kWeightedCycles             # <<<<<<<<<<<<<<
 *   UNWEIGHTED_CYCLES = fst.kUnweightedCycles
 *   # TODO(wolfsonkin): Figure out how to keep the composite properties (all the
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kWeightedCycles); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_WEIGHTED_CYCLES, __pyx_t_8) < 0) __PYX_ERR(0, 3304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3305
 *   NOT_STRING = fst.kNotString
 *   WEIGHTED_CYCLES = fst.kWeightedCycles
 *   UNWEIGHTED_CYCLES = fst.kUnweightedCycles             # <<<<<<<<<<<<<<
 *   # TODO(wolfsonkin): Figure out how to keep the composite properties (all the
 *   # below properties) out of the `repr`, but still available as an attribute on
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kUnweightedCycles); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_UNWEIGHTED_CYCLES, __pyx_t_8) < 0) __PYX_ERR(0, 3305, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3309
 *   # below properties) out of the `repr`, but still available as an attribute on
 *   # the class. I think this could be done with `property`.
 *   NULL_PROPERTIES = fst.kNullProperties             # <<<<<<<<<<<<<<
 *   COPY_PROPERTIES = fst.kCopyProperties
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNullProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NULL_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3309, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3310
 *   # the class. I think this could be done with `property`.
 *   NULL_PROPERTIES = fst.kNullProperties
 *   COPY_PROPERTIES = fst.kCopyProperties             # <<<<<<<<<<<<<<
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 *   EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kCopyProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_COPY_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3311
 *   NULL_PROPERTIES = fst.kNullProperties
 *   COPY_PROPERTIES = fst.kCopyProperties
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties             # <<<<<<<<<<<<<<
 *   EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties
 *   SET_START_PROPERTIES = fst.kSetStartProperties
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kIntrinsicProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_INTRINSIC_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3312
 *   COPY_PROPERTIES = fst.kCopyProperties
 *   INTRINSIC_PROPERTIES = fst.kIntrinsicProperties
 *   EXTRINSIC_PROPERTIES = fst.kExtrinsicProperties             # <<<<<<<<<<<<<<
 *   SET_START_PROPERTIES = fst.kSetStartProperties
 *   SET_FINAL_PROPERTIES = fst.kSetFinalProperties
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kExtrinsicProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_EXTRINSIC_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3312, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3313
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kSetStartProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_SET_START_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3313, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3314
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kSetFinalProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_SET_FINAL_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3315
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kAddStateProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ADD_STATE_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3316
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kAddArcProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ADD_ARC_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3316, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3317
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kSetArcProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_SET_ARC_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3318
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kDeleteStatesProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DELETE_STATE_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3319
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kDeleteArcsProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_DELETE_ARC_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3319, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3320
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kStateSortProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_STATE_SORT_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3321
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kArcSortProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ARC_SORT_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3321, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3322
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kILabelInvariantProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_I_LABEL_INVARIANT_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3322, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3323
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kOLabelInvariantProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_O_LABEL_INVARIANT_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3324
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kWeightInvariantProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_WEIGHT_INVARIANT_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3325
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kAddSuperFinalProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ADD_SUPERFINAL_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3325, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3326
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kRmSuperFinalProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_RM_SUPERFINAL_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3326, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3327
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kBinaryProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BINARY_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3328
 *   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_8 = __Pyx_PyLong_From_uint64_t(fst::kTrinaryProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_TRINARY_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3328, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3329
 *   BINARY_PROPERTIES = fst.kBinaryProperties
 *   TRINARY_PROPERTIES = fst.kTrinaryProperties
 *   POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties             # <<<<<<<<<<<<<<
 *   NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
 *   FST_PROPERTIES = fst.kFstProperties
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kPosTrinaryProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_POS_TRINARY_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3330
 *   TRINARY_PROPERTIES = fst.kTrinaryProperties
 *   POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
 *   NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties             # <<<<<<<<<<<<<<
 *   FST_PROPERTIES = fst.kFstProperties
 * 
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kNegTrinaryProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_NEG_TRINARY_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3330, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3331
 *   POS_TRINARY_PROPERTIES = fst.kPosTrinaryProperties
 *   NEG_TRINARY_PROPERTIES = fst.kNegTrinaryProperties
 *   FST_PROPERTIES = fst.kFstProperties             # <<<<<<<<<<<<<<
 * 
 * for name, member in FstProperties.__members__.items():
*/
  __pyx_t_8 = __Pyx_PyLong_From_uint64_t(fst::kFstProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_FST_PROPERTIES, __pyx_t_8) < 0) __PYX_ERR(0, 3331, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3270
 * 
 * 
 * class FstProperties(enum.Flag):             # <<<<<<<<<<<<<<
 *   EXPANDED = fst.kExpanded
 *   MUTABLE = fst.kMutable
*/
  __pyx_t_8 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_FstProperties, __pyx_t_5, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_FstProperties, __pyx_t_8) < 0) __PYX_ERR(0, 3270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3333
 *   FST_PROPERTIES = fst.kFstProperties
 * 
 * for name, member in FstProperties.__members__.items():             # <<<<<<<<<<<<<<
 *   globals()[name] = member
 * 
*/
  __pyx_t_10 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_FstProperties); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_members); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 3333, __pyx_L1_error)
  }
  __pyx_t_7 = __Pyx_dict_iterator(__pyx_t_2, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_11), (&__pyx_t_6)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_XDECREF(__pyx_t_5);
  __pyx_t_5 = __pyx_t_7;
  __pyx_t_7 = 0;
  while (1) {
    __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_5, __pyx_t_11, &__pyx_t_10, &__pyx_t_7, &__pyx_t_2, NULL, __pyx_t_6);
    if (unlikely(__pyx_t_12 == 0)) break;
    if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_t_7) < 0) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_member, __pyx_t_2) < 0) __PYX_ERR(0, 3333, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "pywrapfst.pyx":3334
 * 
 * for name, member in FstProperties.__members__.items():
 *   globals()[name] = member             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_member); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_Globals(); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely(__pyx_t_7 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3334, __pyx_L1_error)
    }
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (unlikely((PyObject_SetItem(__pyx_t_7, __pyx_t_8, __pyx_t_2) < 0))) __PYX_ERR(0, 3334, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3340
 * 
 * 
 * class WeightProperties(enum.Flag):             # <<<<<<<<<<<<<<
 *   LEFT_SEMIRING = fst.kLeftSemiring
 *   RIGHT_SEMIRING = fst.kRightSemiring
*/
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_Flag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_Py3MetaclassPrepare(__pyx_t_8, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_WeightProperties, __pyx_mstate_global->__pyx_n_u_WeightProperties, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_2 != __pyx_t_5) {
    if (unlikely((PyDict_SetItemString(__pyx_t_7, "__orig_bases__", __pyx_t_5) < 0))) __PYX_ERR(0, 3340, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3341
 * 
 * class WeightProperties(enum.Flag):
 *   LEFT_SEMIRING = fst.kLeftSemiring             # <<<<<<<<<<<<<<
 *   RIGHT_SEMIRING = fst.kRightSemiring
 *   SEMIRING = fst.kSemiring
*/
  __pyx_t_5 = __Pyx_PyLong_From_uint64_t(fst::kLeftSemiring); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_LEFT_SEMIRING, __pyx_t_5) < 0) __PYX_ERR(0, 3341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3342
 * class WeightProperties(enum.Flag):
 *   LEFT_SEMIRING = fst.kLeftSemiring
 *   RIGHT_SEMIRING = fst.kRightSemiring             # <<<<<<<<<<<<<<
 *   SEMIRING = fst.kSemiring
 *   COMMUTATIVE = fst.kCommutative
*/
  __pyx_t_5 = __Pyx_PyLong_From_uint64_t(fst::kRightSemiring); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_RIGHT_SEMIRING, __pyx_t_5) < 0) __PYX_ERR(0, 3342, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3343
 *   LEFT_SEMIRING = fst.kLeftSemiring
 *   RIGHT_SEMIRING = fst.kRightSemiring
 *   SEMIRING = fst.kSemiring             # <<<<<<<<<<<<<<
 *   COMMUTATIVE = fst.kCommutative
 *   IDEMPOTENT = fst.kIdempotent
*/
  __pyx_t_5 = __Pyx_PyLong_From_uint64_t(fst::kSemiring); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_SEMIRING, __pyx_t_5) < 0) __PYX_ERR(0, 3343, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3344
 *   RIGHT_SEMIRING = fst.kRightSemiring
 *   SEMIRING = fst.kSemiring
 *   COMMUTATIVE = fst.kCommutative             # <<<<<<<<<<<<<<
 *   IDEMPOTENT = fst.kIdempotent
 *   PATH = fst.kPath
*/
  __pyx_t_5 = __Pyx_PyLong_From_uint64_t(fst::kCommutative); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_COMMUTATIVE, __pyx_t_5) < 0) __PYX_ERR(0, 3344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3345
 *   SEMIRING = fst.kSemiring
 *   COMMUTATIVE = fst.kCommutative
 *   IDEMPOTENT = fst.kIdempotent             # <<<<<<<<<<<<<<
 *   PATH = fst.kPath
 * 
*/
  __pyx_t_5 = __Pyx_PyLong_From_uint64_t(fst::kIdempotent); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_IDEMPOTENT, __pyx_t_5) < 0) __PYX_ERR(0, 3345, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3346
 *   COMMUTATIVE = fst.kCommutative
 *   IDEMPOTENT = fst.kIdempotent
 *   PATH = fst.kPath             # <<<<<<<<<<<<<<
 * 
 * for name, member in WeightProperties.__members__.items():
*/
  __pyx_t_5 = __Pyx_PyLong_From_uint64_t(fst::kPath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetNameInClass(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_PATH, __pyx_t_5) < 0) __PYX_ERR(0, 3346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":3340
 * 
 * 
 * class WeightProperties(enum.Flag):             # <<<<<<<<<<<<<<
 *   LEFT_SEMIRING = fst.kLeftSemiring
 *   RIGHT_SEMIRING = fst.kRightSemiring
*/
  __pyx_t_5 = __Pyx_Py3ClassCreate(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_WeightProperties, __pyx_t_2, __pyx_t_7, NULL, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_WeightProperties, __pyx_t_5) < 0) __PYX_ERR(0, 3340, __pyx_L1_error)
  __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3348
 *   PATH = fst.kPath
 * 
 * for name, member in WeightProperties.__members__.items():             # <<<<<<<<<<<<<<
 *    globals()[name] = member
 * 
*/
  __pyx_t_11 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_WeightProperties); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_members); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(__pyx_t_7 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 3348, __pyx_L1_error)
  }
  __pyx_t_8 = __Pyx_dict_iterator(__pyx_t_7, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_10), (&__pyx_t_6)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_8;
  __pyx_t_8 = 0;
  while (1) {
    __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_10, &__pyx_t_11, &__pyx_t_8, &__pyx_t_7, NULL, __pyx_t_6);
    if (unlikely(__pyx_t_12 == 0)) break;
    if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 3348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GOTREF(__pyx_t_7);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_t_8) < 0) __PYX_ERR(0, 3348, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_member, __pyx_t_7) < 0) __PYX_ERR(0, 3348, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "pywrapfst.pyx":3349
 * 
 * for name, member in WeightProperties.__members__.items():
 *    globals()[name] = member             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_member); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_Globals(); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (unlikely(__pyx_t_8 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3349, __pyx_L1_error)
    }
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely((PyObject_SetItem(__pyx_t_8, __pyx_t_5, __pyx_t_7) < 0))) __PYX_ERR(0, 3349, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3355
 * 
 * 
 * class ArcIteratorFlags(enum.Flag):             # <<<<<<<<<<<<<<
 *   ARC_I_LABEL_VALUE = fst.kArcILabelValue
 *   ARC_O_LABEL_VALUE = fst.kArcOLabelValue
*/
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_enum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Flag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_Pack(1, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_7, __pyx_mstate_global->__pyx_n_u_ArcIteratorFlags, __pyx_mstate_global->__pyx_n_u_ArcIteratorFlags, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__pyx_t_7 != __pyx_t_2) {
    if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 3355, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3356
 * 
 * class ArcIteratorFlags(enum.Flag):
 *   ARC_I_LABEL_VALUE = fst.kArcILabelValue             # <<<<<<<<<<<<<<
 *   ARC_O_LABEL_VALUE = fst.kArcOLabelValue
 *   ARC_WEIGHT_VALUE = fst.kArcWeightValue
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint8_t(fst::kArcILabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ARC_I_LABEL_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3356, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3357
 * class ArcIteratorFlags(enum.Flag):
 *   ARC_I_LABEL_VALUE = fst.kArcILabelValue
 *   ARC_O_LABEL_VALUE = fst.kArcOLabelValue             # <<<<<<<<<<<<<<
 *   ARC_WEIGHT_VALUE = fst.kArcWeightValue
 *   ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint8_t(fst::kArcOLabelValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ARC_O_LABEL_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3358
 *   ARC_I_LABEL_VALUE = fst.kArcILabelValue
 *   ARC_O_LABEL_VALUE = fst.kArcOLabelValue
 *   ARC_WEIGHT_VALUE = fst.kArcWeightValue             # <<<<<<<<<<<<<<
 *   ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
 *   ARC_NO_CACHE = fst.kArcNoCache
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint8_t(fst::kArcWeightValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ARC_WEIGHT_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3358, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3359
 *   ARC_O_LABEL_VALUE = fst.kArcOLabelValue
 *   ARC_WEIGHT_VALUE = fst.kArcWeightValue
 *   ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue             # <<<<<<<<<<<<<<
 *   ARC_NO_CACHE = fst.kArcNoCache
 *   ARC_VALUE_FLAGS = fst.kArcValueFlags
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint8_t(fst::kArcNextStateValue); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ARC_NEXT_STATE_VALUE, __pyx_t_2) < 0) __PYX_ERR(0, 3359, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3360
 *   ARC_WEIGHT_VALUE = fst.kArcWeightValue
 *   ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
 *   ARC_NO_CACHE = fst.kArcNoCache             # <<<<<<<<<<<<<<
 *   ARC_VALUE_FLAGS = fst.kArcValueFlags
 *   ARC_FLAGS = fst.kArcFlags
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint8_t(fst::kArcNoCache); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ARC_NO_CACHE, __pyx_t_2) < 0) __PYX_ERR(0, 3360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3361
 *   ARC_NEXT_STATE_VALUE = fst.kArcNextStateValue
 *   ARC_NO_CACHE = fst.kArcNoCache
 *   ARC_VALUE_FLAGS = fst.kArcValueFlags             # <<<<<<<<<<<<<<
 *   ARC_FLAGS = fst.kArcFlags
 * 
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint8_t(fst::kArcValueFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ARC_VALUE_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3362
 *   ARC_NO_CACHE = fst.kArcNoCache
 *   ARC_VALUE_FLAGS = fst.kArcValueFlags
 *   ARC_FLAGS = fst.kArcFlags             # <<<<<<<<<<<<<<
 * 
 * for name, member in ArcIteratorFlags.__members__.items():
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint8_t(fst::kArcFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_ARC_FLAGS, __pyx_t_2) < 0) __PYX_ERR(0, 3362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":3355
 * 
 * 
 * class ArcIteratorFlags(enum.Flag):             # <<<<<<<<<<<<<<
 *   ARC_I_LABEL_VALUE = fst.kArcILabelValue
 *   ARC_O_LABEL_VALUE = fst.kArcOLabelValue
*/
  __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ArcIteratorFlags, __pyx_t_7, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_ArcIteratorFlags, __pyx_t_2) < 0) __PYX_ERR(0, 3355, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":3364
 *   ARC_FLAGS = fst.kArcFlags
 * 
 * for name, member in ArcIteratorFlags.__members__.items():             # <<<<<<<<<<<<<<
 *    globals()[name] = member
 * 
*/
  __pyx_t_10 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ArcIteratorFlags); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_members); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(__pyx_t_8 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 3364, __pyx_L1_error)
  }
  __pyx_t_5 = __Pyx_dict_iterator(__pyx_t_8, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_11), (&__pyx_t_6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_XDECREF(__pyx_t_7);
  __pyx_t_7 = __pyx_t_5;
  __pyx_t_5 = 0;
  while (1) {
    __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_7, __pyx_t_11, &__pyx_t_10, &__pyx_t_5, &__pyx_t_8, NULL, __pyx_t_6);
    if (unlikely(__pyx_t_12 == 0)) break;
    if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 3364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GOTREF(__pyx_t_8);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_t_5) < 0) __PYX_ERR(0, 3364, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_member, __pyx_t_8) < 0) __PYX_ERR(0, 3364, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "pywrapfst.pyx":3365
 * 
 * for name, member in ArcIteratorFlags.__members__.items():
 *    globals()[name] = member             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_member); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_5 = __Pyx_Globals(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__pyx_t_5 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3365, __pyx_L1_error)
    }
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3365, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely((PyObject_SetItem(__pyx_t_5, __pyx_t_2, __pyx_t_8) < 0))) __PYX_ERR(0, 3365, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":3371
 * 
 * 
 * class EncodeMapperFlags(enum.Flag):             # <<<<<<<<<<<<<<
 *   ENCODE_LABELS = fst.kEncodeLabels
 *   ENCODE_WEIGHTS = fst.kEncodeWeights
*/
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_enum); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_Flag); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyTuple_Pack(1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PEP560_update_bases(__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_8, __pyx_mstate_global->__pyx_n_u_EncodeMapperFlags, __pyx_mstate_global->__pyx_n_u_EncodeMapperFlags, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_8 != __pyx_t_7) {
    if (unlikely((PyDict_SetItemString(__pyx_t_5, "__orig_bases__", __pyx_t_7) < 0))) __PYX_ERR(0, 3371, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":3372
 * 
 * class EncodeMapperFlags(enum.Flag):
 *   ENCODE_LABELS = fst.kEncodeLabels             # <<<<<<<<<<<<<<
 *   ENCODE_WEIGHTS = fst.kEncodeWeights
 *   ENCODE_FLAGS = fst.kEncodeFlags
*/
  __pyx_t_7 = __Pyx_PyLong_From_uint8_t(fst::kEncodeLabels); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ENCODE_LABELS, __pyx_t_7) < 0) __PYX_ERR(0, 3372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":3373
 * class EncodeMapperFlags(enum.Flag):
 *   ENCODE_LABELS = fst.kEncodeLabels
 *   ENCODE_WEIGHTS = fst.kEncodeWeights             # <<<<<<<<<<<<<<
 *   ENCODE_FLAGS = fst.kEncodeFlags
 * 
*/
  __pyx_t_7 = __Pyx_PyLong_From_uint8_t(fst::kEncodeWeights); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ENCODE_WEIGHTS, __pyx_t_7) < 0) __PYX_ERR(0, 3373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":3374
 *   ENCODE_LABELS = fst.kEncodeLabels
 *   ENCODE_WEIGHTS = fst.kEncodeWeights
 *   ENCODE_FLAGS = fst.kEncodeFlags             # <<<<<<<<<<<<<<
 * 
 * for name, member in EncodeMapperFlags.__members__.items():
*/
  __pyx_t_7 = __Pyx_PyLong_From_uint8_t(fst::kEncodeFlags); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3374, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetNameInClass(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_ENCODE_FLAGS, __pyx_t_7) < 0) __PYX_ERR(0, 3374, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":3371
 * 
 * 
 * class EncodeMapperFlags(enum.Flag):             # <<<<<<<<<<<<<<
 *   ENCODE_LABELS = fst.kEncodeLabels
 *   ENCODE_WEIGHTS = fst.kEncodeWeights
*/
  __pyx_t_7 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_EncodeMapperFlags, __pyx_t_8, __pyx_t_5, NULL, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_EncodeMapperFlags, __pyx_t_7) < 0) __PYX_ERR(0, 3371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3376
 *   ENCODE_FLAGS = fst.kEncodeFlags
 * 
 * for name, member in EncodeMapperFlags.__members__.items():             # <<<<<<<<<<<<<<
 *    globals()[name] = member
 * 
*/
  __pyx_t_11 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_EncodeMapperFlags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_members); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(__pyx_t_5 == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
    __PYX_ERR(0, 3376, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_dict_iterator(__pyx_t_5, 0, __pyx_mstate_global->__pyx_n_u_items, (&__pyx_t_10), (&__pyx_t_6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_XDECREF(__pyx_t_8);
  __pyx_t_8 = __pyx_t_2;
  __pyx_t_2 = 0;
  while (1) {
    __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_8, __pyx_t_10, &__pyx_t_11, &__pyx_t_2, &__pyx_t_5, NULL, __pyx_t_6);
    if (unlikely(__pyx_t_12 == 0)) break;
    if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 3376, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_name_2, __pyx_t_2) < 0) __PYX_ERR(0, 3376, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_member, __pyx_t_5) < 0) __PYX_ERR(0, 3376, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "pywrapfst.pyx":3377
 * 
 * for name, member in EncodeMapperFlags.__members__.items():
 *    globals()[name] = member             # <<<<<<<<<<<<<<
 * 
 * 
*/
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_member); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__pyx_t_2 == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 3377, __pyx_L1_error)
    }
    __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_name_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (unlikely((PyObject_SetItem(__pyx_t_2, __pyx_t_7, __pyx_t_5) < 0))) __PYX_ERR(0, 3377, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3406
 *     self._arc.reset(new fst.ArcClass(ilabel, olabel, _weight, nextstate))
 * 
 *   cpdef Arc copy(self):             # <<<<<<<<<<<<<<
 *     return Arc(self.ilabel, self.olabel, self.weight, self.nextstate)
 * 
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Arc_5copy, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Arc_copy, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[111])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Arc, __pyx_mstate_global->__pyx_n_u_copy, __pyx_t_8) < 0) __PYX_ERR(0, 3406, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(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):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Arc_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Arc___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[112])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_8) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(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"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_3Arc_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Arc___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[113])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3486
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_9done, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator_done, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[114])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_mstate_global->__pyx_n_u_done, __pyx_t_8) < 0) __PYX_ERR(0, 3486, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3498
 *       return self._it.get().Done()
 * 
 *   def flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_11flags, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator_flags, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[115])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_mstate_global->__pyx_n_u_flags, __pyx_t_8) < 0) __PYX_ERR(0, 3498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3512
 *     return ArcIteratorFlags(_flags)
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_13next, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator_next, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[116])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_mstate_global->__pyx_n_u_next, __pyx_t_8) < 0) __PYX_ERR(0, 3512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3521
 *       self._it.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_15position, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator_position, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[117])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_mstate_global->__pyx_n_u_position, __pyx_t_8) < 0) __PYX_ERR(0, 3521, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3535
 *     return _pos
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_17reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator_reset, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[118])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_8) < 0) __PYX_ERR(0, 3535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3544
 *       self._it.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_19seek, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator_seek, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[119])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_mstate_global->__pyx_n_u_seek, __pyx_t_8) < 0) __PYX_ERR(0, 3544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3556
 *       self._it.get().Seek(a)
 * 
 *   def set_flags(self, flags, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_21set_flags, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator_set_flags, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[120])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_mstate_global->__pyx_n_u_set_flags, __pyx_t_8) < 0) __PYX_ERR(0, 3556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3574
 *     return _init_Arc(self._it.get().Value())
 * 
 *   def value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_23value, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator_value, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[121])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__ArcIterator, __pyx_mstate_global->__pyx_n_u_value, __pyx_t_8) < 0) __PYX_ERR(0, 3574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_25__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[122])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_8) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_12_ArcIterator_27__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_ArcIterator___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[123])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3629
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_9done, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_done, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[124])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_done, __pyx_t_8) < 0) __PYX_ERR(0, 3629, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3641
 *       return self._mit.get().Done()
 * 
 *   def flags(self):             # <<<<<<<<<<<<<<
 *     """
 *     flags(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_11flags, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_flags, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[125])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_flags, __pyx_t_8) < 0) __PYX_ERR(0, 3641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3655
 *     return ArcIteratorFlags(_flags)
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_13next, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_next, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[126])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3655, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_next, __pyx_t_8) < 0) __PYX_ERR(0, 3655, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3664
 *       self._mit.get().Next()
 * 
 *   cpdef size_t position(self):             # <<<<<<<<<<<<<<
 *     """
 *     position(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_15position, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_position, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[127])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_position, __pyx_t_8) < 0) __PYX_ERR(0, 3664, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3678
 *     return _pos
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_17reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_reset, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[128])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_8) < 0) __PYX_ERR(0, 3678, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3687
 *       self._mit.get().Reset()
 * 
 *   cpdef void seek(self, size_t a):             # <<<<<<<<<<<<<<
 *     """
 *     seek(self, a)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_19seek, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_seek, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[129])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3687, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_seek, __pyx_t_8) < 0) __PYX_ERR(0, 3687, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3699
 *       self._mit.get().Seek(a)
 * 
 *   def set_flags(self, flags, mask):             # <<<<<<<<<<<<<<
 *     """
 *     set_flags(self, flags, mask)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_21set_flags, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_set_flags, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[130])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_set_flags, __pyx_t_8) < 0) __PYX_ERR(0, 3699, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3714
 *       self._mit.get().SetFlags(_flags, _mask)
 * 
 *   cpdef void set_value(self, Arc arc) except *:             # <<<<<<<<<<<<<<
 *     """
 *     set_value(self, arc)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_23set_value, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_set_value, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[131])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_set_value, __pyx_t_8) < 0) __PYX_ERR(0, 3714, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3734
 *     return _init_Arc(self._mit.get().Value())
 * 
 *   def value(self):             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_25value, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator_value, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[132])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__MutableArcIterator, __pyx_mstate_global->__pyx_n_u_value, __pyx_t_8) < 0) __PYX_ERR(0, 3734, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_27__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator___reduce_cyt, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[133])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_8) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it,self._mfst,self._mit cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_19_MutableArcIterator_29__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MutableArcIterator___setstate_c, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[134])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3782
 *     return result
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_14_StateIterator_9done, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_StateIterator_done, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[135])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator, __pyx_mstate_global->__pyx_n_u_done, __pyx_t_8) < 0) __PYX_ERR(0, 3782, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3794
 *       return self._it.get().Done()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_14_StateIterator_11next, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_StateIterator_next, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[136])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator, __pyx_mstate_global->__pyx_n_u_next, __pyx_t_8) < 0) __PYX_ERR(0, 3794, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3803
 *       self._it.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_14_StateIterator_13reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_StateIterator_reset, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[137])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_8) < 0) __PYX_ERR(0, 3803, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3816
 *       return self._it.get().Value()
 * 
 *   cpdef int64_t value(self) except *:             # <<<<<<<<<<<<<<
 *     """
 *     value(self)
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_14_StateIterator_15value, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_StateIterator_value, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[138])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3816, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst__StateIterator, __pyx_mstate_global->__pyx_n_u_value, __pyx_t_8) < 0) __PYX_ERR(0, 3816, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_14_StateIterator_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_StateIterator___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[139])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_8) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._fst,self._it cannot be converted to a Python object for pickling"
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_14_StateIterator_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_StateIterator___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[140])); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_8) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3837
 * 
 * cdef Fst _map(Fst ifst,
 *                float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                map_type="identity",
 *                double power=1.,
*/
  __pyx_mstate_global->__pyx_k__19 = fst::kDelta;

  /* "pywrapfst.pyx":3856
 * 
 * cpdef Fst arcmap(Fst ifst,
 *                  float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                  map_type="identity",
 *                  double power=1.,
*/
  __pyx_mstate_global->__pyx_k__20 = fst::kDelta;

  /* "pywrapfst.pyx":3855
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
*/
  __pyx_t_8 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pywrapfst.pyx":3859
 *                  map_type="identity",
 *                  double power=1.,
 *                  weight=None):             # <<<<<<<<<<<<<<
 *   """
 *   arcmap(ifst, delta=0.0009765625, map_type="identity", power=1., weight=None)
*/
  __pyx_t_5 = PyTuple_Pack(4, __pyx_t_8, __pyx_mstate_global->__pyx_n_u_identity, __pyx_mstate_global->__pyx_float_1_, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3855
 * 
 * 
 * cpdef Fst arcmap(Fst ifst,             # <<<<<<<<<<<<<<
 *                  float delta=fst.kDelta,
 *                  map_type="identity",
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_21arcmap, 0, __pyx_mstate_global->__pyx_n_u_arcmap, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[141])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_arcmap, __pyx_t_8) < 0) __PYX_ERR(0, 3855, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3902
 * 
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter="auto",
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_23compose, 0, __pyx_mstate_global->__pyx_n_u_compose, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[142])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[9]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_compose, __pyx_t_8) < 0) __PYX_ERR(0, 3902, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3942
 * 
 * 
 * cpdef Fst convert(Fst ifst, fst_type=""):             # <<<<<<<<<<<<<<
 *   """
 *   convert(ifst, fst_type="")
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_25convert, 0, __pyx_mstate_global->__pyx_n_u_convert, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[143])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_mstate_global->__pyx_tuple[10]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_convert, __pyx_t_8) < 0) __PYX_ERR(0, 3942, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":3970
 * 
 * cpdef MutableFst determinize(Fst ifst,
 *                              float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                              det_type="functional",
 *                              int64_t nstate=fst.kNoStateId,
*/
  __pyx_mstate_global->__pyx_k__21 = fst::kShortestDelta;

  /* "pywrapfst.pyx":3972
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
 *                              int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                              int64_t subsequential_label=0,
 *                              weight=None,
*/
  __pyx_mstate_global->__pyx_k__22 = fst::kNoStateId;

  /* "pywrapfst.pyx":3970
 * 
 * cpdef MutableFst determinize(Fst ifst,
 *                              float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                              det_type="functional",
 *                              int64_t nstate=fst.kNoStateId,
*/
  __pyx_t_8 = PyFloat_FromDouble(fst::kShortestDelta); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 3970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pywrapfst.pyx":3972
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
 *                              int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                              int64_t subsequential_label=0,
 *                              weight=None,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pywrapfst.pyx":3969
 * 
 * 
 * cpdef MutableFst determinize(Fst ifst,             # <<<<<<<<<<<<<<
 *                              float delta=fst.kShortestDelta,
 *                              det_type="functional",
*/
  __pyx_t_7 = PyTuple_Pack(6, __pyx_t_8, __pyx_mstate_global->__pyx_n_u_functional, __pyx_t_5, __pyx_mstate_global->__pyx_int_0, Py_None, Py_False); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 3969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_27determinize, 0, __pyx_mstate_global->__pyx_n_u_determinize, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[144])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 3969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_determinize, __pyx_t_5) < 0) __PYX_ERR(0, 3969, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":4029
 * 
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter="auto",
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_29difference, 0, __pyx_mstate_global->__pyx_n_u_difference, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[145])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_mstate_global->__pyx_tuple[11]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_difference, __pyx_t_5) < 0) __PYX_ERR(0, 4029, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":4071
 * 
 * cpdef MutableFst disambiguate(Fst ifst,
 *                               float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                               int64_t nstate=fst.kNoStateId,
 *                               int64_t subsequential_label=0,
*/
  __pyx_mstate_global->__pyx_k__23 = fst::kDelta;

  /* "pywrapfst.pyx":4072
 * cpdef MutableFst disambiguate(Fst ifst,
 *                               float delta=fst.kDelta,
 *                               int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               int64_t subsequential_label=0,
 *                               weight=None):
*/
  __pyx_mstate_global->__pyx_k__24 = fst::kNoStateId;

  /* "pywrapfst.pyx":4071
 * 
 * cpdef MutableFst disambiguate(Fst ifst,
 *                               float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                               int64_t nstate=fst.kNoStateId,
 *                               int64_t subsequential_label=0,
*/
  __pyx_t_5 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pywrapfst.pyx":4072
 * cpdef MutableFst disambiguate(Fst ifst,
 *                               float delta=fst.kDelta,
 *                               int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               int64_t subsequential_label=0,
 *                               weight=None):
*/
  __pyx_t_7 = __Pyx_PyLong_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pywrapfst.pyx":4070
 * 
 * 
 * cpdef MutableFst disambiguate(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kDelta,
 *                               int64_t nstate=fst.kNoStateId,
*/
  __pyx_t_8 = PyTuple_Pack(4, __pyx_t_5, __pyx_t_7, __pyx_mstate_global->__pyx_int_0, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_31disambiguate, 0, __pyx_mstate_global->__pyx_n_u_disambiguate, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[146])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_disambiguate, __pyx_t_7) < 0) __PYX_ERR(0, 4070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4114
 * 
 * 
 * cpdef MutableFst epsnormalize(Fst ifst, eps_norm_type="input"):             # <<<<<<<<<<<<<<
 *   """
 *   epsnormalize(ifst, eps_norm_type="input")
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_33epsnormalize, 0, __pyx_mstate_global->__pyx_n_u_epsnormalize, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[147])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[12]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_epsnormalize, __pyx_t_7) < 0) __PYX_ERR(0, 4114, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4143
 * 
 * 
 * cpdef bool equal(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   equal(ifst1, ifst2, delta=0.0009765625)
*/
  __pyx_mstate_global->__pyx_k__25 = fst::kDelta;
  __pyx_t_7 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_Pack(1, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_35equal, 0, __pyx_mstate_global->__pyx_n_u_equal, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[148])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_equal, __pyx_t_7) < 0) __PYX_ERR(0, 4143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4165
 * 
 * 
 * cpdef bool equivalent(Fst ifst1, Fst ifst2, float delta=fst.kDelta) except *:             # <<<<<<<<<<<<<<
 *   """
 *   equivalent(ifst1, ifst2, delta=0.0009765625)
*/
  __pyx_mstate_global->__pyx_k__26 = fst::kDelta;
  __pyx_t_7 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_Pack(1, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_37equivalent, 0, __pyx_mstate_global->__pyx_n_u_equivalent, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[149])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_equivalent, __pyx_t_7) < 0) __PYX_ERR(0, 4165, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4196
 * 
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter="auto",
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_39intersect, 0, __pyx_mstate_global->__pyx_n_u_intersect, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[150])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[13]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_intersect, __pyx_t_7) < 0) __PYX_ERR(0, 4196, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4235
 * 
 * 
 * cpdef bool isomorphic(Fst ifst1, Fst ifst2, float delta=fst.kDelta):             # <<<<<<<<<<<<<<
 *   """
 *   isomorphic(ifst1, ifst2, delta=0.0009765625)
*/
  __pyx_mstate_global->__pyx_k__27 = fst::kDelta;
  __pyx_t_7 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_Pack(1, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_41isomorphic, 0, __pyx_mstate_global->__pyx_n_u_isomorphic, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[151])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_8);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_isomorphic, __pyx_t_7) < 0) __PYX_ERR(0, 4235, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4261
 * 
 * cpdef MutableFst prune(Fst ifst,
 *                        float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                        int64_t nstate=fst.kNoStateId,
 *                        weight=None):
*/
  __pyx_mstate_global->__pyx_k__28 = fst::kDelta;

  /* "pywrapfst.pyx":4262
 * cpdef MutableFst prune(Fst ifst,
 *                        float delta=fst.kDelta,
 *                        int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                        weight=None):
 *   """
*/
  __pyx_mstate_global->__pyx_k__29 = fst::kNoStateId;

  /* "pywrapfst.pyx":4261
 * 
 * cpdef MutableFst prune(Fst ifst,
 *                        float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                        int64_t nstate=fst.kNoStateId,
 *                        weight=None):
*/
  __pyx_t_7 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pywrapfst.pyx":4262
 * cpdef MutableFst prune(Fst ifst,
 *                        float delta=fst.kDelta,
 *                        int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                        weight=None):
 *   """
*/
  __pyx_t_8 = __Pyx_PyLong_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pywrapfst.pyx":4260
 * 
 * 
 * cpdef MutableFst prune(Fst ifst,             # <<<<<<<<<<<<<<
 *                        float delta=fst.kDelta,
 *                        int64_t nstate=fst.kNoStateId,
*/
  __pyx_t_5 = PyTuple_Pack(3, __pyx_t_7, __pyx_t_8, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_43prune, 0, __pyx_mstate_global->__pyx_n_u_prune, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[152])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_prune, __pyx_t_8) < 0) __PYX_ERR(0, 4260, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":4294
 * 
 * cpdef MutableFst push(Fst ifst,
 *                       float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                       bool push_weights=False,
 *                       bool push_labels=False,
*/
  __pyx_mstate_global->__pyx_k__30 = fst::kDelta;

  /* "pywrapfst.pyx":4293
 * 
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
*/
  __pyx_t_8 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pywrapfst.pyx":4298
 *                       bool push_labels=False,
 *                       bool remove_common_affix=False,
 *                       bool remove_total_weight=False,             # <<<<<<<<<<<<<<
 *                       reweight_type="to_initial"):
 *   """
*/
  __pyx_t_5 = PyTuple_Pack(6, __pyx_t_8, Py_False, Py_False, Py_False, Py_False, __pyx_mstate_global->__pyx_n_u_to_initial); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":4293
 * 
 * 
 * cpdef MutableFst push(Fst ifst,             # <<<<<<<<<<<<<<
 *                       float delta=fst.kDelta,
 *                       bool push_weights=False,
*/
  __pyx_t_8 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_45push, 0, __pyx_mstate_global->__pyx_n_u_push, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[153])); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_push, __pyx_t_8) < 0) __PYX_ERR(0, 4293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "pywrapfst.pyx":4352
 *                           Fst ifst2,
 *                           int32_t npath=1,
 *                           float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                           select="uniform",
 *                           int32_t max_length=numeric_limits[int32_t].max(),
*/
  __pyx_mstate_global->__pyx_k__31 = fst::kDelta;

  /* "pywrapfst.pyx":4354
 *                           float delta=fst.kDelta,
 *                           select="uniform",
 *                           int32_t max_length=numeric_limits[int32_t].max(),             # <<<<<<<<<<<<<<
 *                           uint64_t seed=fst.kDefaultSeed) except *:
 *   """
*/
  __pyx_mstate_global->__pyx_k__32 = std::numeric_limits<int32_t> ::max();

  /* "pywrapfst.pyx":4355
 *                           select="uniform",
 *                           int32_t max_length=numeric_limits[int32_t].max(),
 *                           uint64_t seed=fst.kDefaultSeed) except *:             # <<<<<<<<<<<<<<
 *   """
 *   randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, select="uniform",
*/
  __pyx_mstate_global->__pyx_k__33 = fst::script::kDefaultSeed;

  /* "pywrapfst.pyx":4352
 *                           Fst ifst2,
 *                           int32_t npath=1,
 *                           float delta=fst.kDelta,             # <<<<<<<<<<<<<<
 *                           select="uniform",
 *                           int32_t max_length=numeric_limits[int32_t].max(),
*/
  __pyx_t_8 = PyFloat_FromDouble(fst::kDelta); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 4352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);

  /* "pywrapfst.pyx":4354
 *                           float delta=fst.kDelta,
 *                           select="uniform",
 *                           int32_t max_length=numeric_limits[int32_t].max(),             # <<<<<<<<<<<<<<
 *                           uint64_t seed=fst.kDefaultSeed) except *:
 *   """
*/
  __pyx_t_5 = __Pyx_PyLong_From_int32_t(std::numeric_limits<int32_t> ::max()); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pywrapfst.pyx":4355
 *                           select="uniform",
 *                           int32_t max_length=numeric_limits[int32_t].max(),
 *                           uint64_t seed=fst.kDefaultSeed) except *:             # <<<<<<<<<<<<<<
 *   """
 *   randequivalent(ifst1, ifst2, npath=1, delta=0.0009765625, select="uniform",
*/
  __pyx_t_7 = __Pyx_PyLong_From_uint64_t(fst::script::kDefaultSeed); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pywrapfst.pyx":4349
 * 
 * 
 * cpdef bool randequivalent(Fst ifst1,             # <<<<<<<<<<<<<<
 *                           Fst ifst2,
 *                           int32_t npath=1,
*/
  __pyx_t_2 = PyTuple_Pack(5, __pyx_mstate_global->__pyx_int_1, __pyx_t_8, __pyx_mstate_global->__pyx_n_u_uniform, __pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4349, __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_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_47randequivalent, 0, __pyx_mstate_global->__pyx_n_u_randequivalent, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[154])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_randequivalent, __pyx_t_7) < 0) __PYX_ERR(0, 4349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4404
 *                          int32_t npath=1,
 *                          select="uniform",
 *                          int32_t max_length=numeric_limits[int32_t].max(),             # <<<<<<<<<<<<<<
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,
*/
  __pyx_mstate_global->__pyx_k__34 = std::numeric_limits<int32_t> ::max();

  /* "pywrapfst.pyx":4407
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,
 *                          uint64_t seed=fst.kDefaultSeed):             # <<<<<<<<<<<<<<
 *   """
 *   randgen(ifst, npath=1, seed=0, select="uniform", max_length=2147483647,
*/
  __pyx_mstate_global->__pyx_k__35 = fst::script::kDefaultSeed;

  /* "pywrapfst.pyx":4404
 *                          int32_t npath=1,
 *                          select="uniform",
 *                          int32_t max_length=numeric_limits[int32_t].max(),             # <<<<<<<<<<<<<<
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,
*/
  __pyx_t_7 = __Pyx_PyLong_From_int32_t(std::numeric_limits<int32_t> ::max()); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);

  /* "pywrapfst.pyx":4407
 *                          bool weighted=False,
 *                          bool remove_total_weight=False,
 *                          uint64_t seed=fst.kDefaultSeed):             # <<<<<<<<<<<<<<
 *   """
 *   randgen(ifst, npath=1, seed=0, select="uniform", max_length=2147483647,
*/
  __pyx_t_2 = __Pyx_PyLong_From_uint64_t(fst::script::kDefaultSeed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":4401
 * 
 * 
 * cpdef MutableFst randgen(Fst ifst,             # <<<<<<<<<<<<<<
 *                          int32_t npath=1,
 *                          select="uniform",
*/
  __pyx_t_5 = PyTuple_Pack(6, __pyx_mstate_global->__pyx_int_1, __pyx_mstate_global->__pyx_n_u_uniform, __pyx_t_7, Py_False, Py_False, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_49randgen, 0, __pyx_mstate_global->__pyx_n_u_randgen, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[155])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_randgen, __pyx_t_2) < 0) __PYX_ERR(0, 4401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":4453
 * 
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_51replace, 0, __pyx_mstate_global->__pyx_n_u_replace, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[156])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[14]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_replace, __pyx_t_2) < 0) __PYX_ERR(0, 4453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":4514
 * 
 * 
 * cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
 *   """
 *   reverse(ifst, require_superinitial=True)
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_53reverse, 0, __pyx_mstate_global->__pyx_n_u_reverse, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[157])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_mstate_global->__pyx_tuple[15]);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reverse, __pyx_t_2) < 0) __PYX_ERR(0, 4514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":4545
 * cdef void _shortestdistance(Fst ifst,
 *                             vector[fst.WeightClass] *distance,
 *                             float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                             int64_t nstate=fst.kNoStateId,
 *                             queue_type="auto",
*/
  __pyx_mstate_global->__pyx_k__36 = fst::kShortestDelta;

  /* "pywrapfst.pyx":4546
 *                             vector[fst.WeightClass] *distance,
 *                             float delta=fst.kShortestDelta,
 *                             int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                             queue_type="auto",
 *                             bool reverse=False) except *:
*/
  __pyx_mstate_global->__pyx_k__37 = fst::kNoStateId;

  /* "pywrapfst.pyx":4565
 * 
 * 
 * def shortestdistance(Fst ifst,             # <<<<<<<<<<<<<<
 *                      float delta=fst.kShortestDelta,
 *                      int64_t nstate=fst.kNoStateId,
*/
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_55shortestdistance, 0, __pyx_mstate_global->__pyx_n_u_shortestdistance, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[158])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4565, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_2, __pyx_mstate_global->__pyx_ptype_9pywrapfst___pyx_defaults)) __PYX_ERR(0, 4565, __pyx_L1_error)

  /* "pywrapfst.pyx":4566
 * 
 * def shortestdistance(Fst ifst,
 *                      float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                      int64_t nstate=fst.kNoStateId,
 *                      queue_type="auto",
*/
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_2)->arg0 = fst::kShortestDelta;

  /* "pywrapfst.pyx":4567
 * def shortestdistance(Fst ifst,
 *                      float delta=fst.kShortestDelta,
 *                      int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                      queue_type="auto",
 *                      bool reverse=False):
*/
  __Pyx_CyFunction_Defaults(struct __pyx_defaults, __pyx_t_2)->arg1 = fst::kNoStateId;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_2, __pyx_pf_9pywrapfst_62__defaults__);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_shortestdistance, __pyx_t_2) < 0) __PYX_ERR(0, 4565, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "pywrapfst.pyx":4603
 * 
 * cpdef MutableFst shortestpath(Fst ifst,
 *                               float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                               int32_t nshortest=1,
 *                               int64_t nstate=fst.kNoStateId,
*/
  __pyx_mstate_global->__pyx_k__38 = fst::kShortestDelta;

  /* "pywrapfst.pyx":4605
 *                               float delta=fst.kShortestDelta,
 *                               int32_t nshortest=1,
 *                               int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               queue_type="auto",
 *                               bool unique=False,
*/
  __pyx_mstate_global->__pyx_k__39 = fst::kNoStateId;

  /* "pywrapfst.pyx":4603
 * 
 * cpdef MutableFst shortestpath(Fst ifst,
 *                               float delta=fst.kShortestDelta,             # <<<<<<<<<<<<<<
 *                               int32_t nshortest=1,
 *                               int64_t nstate=fst.kNoStateId,
*/
  __pyx_t_2 = PyFloat_FromDouble(fst::kShortestDelta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "pywrapfst.pyx":4605
 *                               float delta=fst.kShortestDelta,
 *                               int32_t nshortest=1,
 *                               int64_t nstate=fst.kNoStateId,             # <<<<<<<<<<<<<<
 *                               queue_type="auto",
 *                               bool unique=False,
*/
  __pyx_t_5 = __Pyx_PyLong_From_int(fst::kNoStateId); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "pywrapfst.pyx":4602
 * 
 * 
 * cpdef MutableFst shortestpath(Fst ifst,             # <<<<<<<<<<<<<<
 *                               float delta=fst.kShortestDelta,
 *                               int32_t nshortest=1,
*/
  __pyx_t_7 = PyTuple_Pack(6, __pyx_t_2, __pyx_mstate_global->__pyx_int_1, __pyx_t_5, __pyx_mstate_global->__pyx_n_u_auto, Py_False, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_57shortestpath, 0, __pyx_mstate_global->__pyx_n_u_shortestpath, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[159])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_5, __pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_shortestpath, __pyx_t_5) < 0) __PYX_ERR(0, 4602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":4657
 * 
 * 
 * cpdef Fst statemap(Fst ifst, map_type):             # <<<<<<<<<<<<<<
 *   """
 *   state_map(ifst, map_type)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_59statemap, 0, __pyx_mstate_global->__pyx_n_u_statemap, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[160])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_statemap, __pyx_t_5) < 0) __PYX_ERR(0, 4657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":4683
 * 
 * 
 * cpdef MutableFst synchronize(Fst ifst):             # <<<<<<<<<<<<<<
 *   """
 *   synchronize(ifst)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_61synchronize, 0, __pyx_mstate_global->__pyx_n_u_synchronize, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[161])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4683, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_synchronize, __pyx_t_5) < 0) __PYX_ERR(0, 4683, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":4787
 *     self._keep_state_numbering = keep_state_numbering
 * 
 *   cpdef Fst compile(self):             # <<<<<<<<<<<<<<
 *     """
 *     compile()
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_8Compiler_3compile, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Compiler_compile, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[162])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Compiler, __pyx_mstate_global->__pyx_n_u_compile, __pyx_t_5) < 0) __PYX_ERR(0, 4787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":4819
 *     return _init_XFst(_tfst.release())
 * 
 *   cpdef void write(self, expression):             # <<<<<<<<<<<<<<
 *     """
 *     write(expression)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_8Compiler_5write, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Compiler_write, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[163])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_Compiler, __pyx_mstate_global->__pyx_n_u_write, __pyx_t_5) < 0) __PYX_ERR(0, 4819, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_8Compiler_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Compiler___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[164])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "no default __reduce__ due to non-trivial __cinit__"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_8Compiler_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Compiler___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[165])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":4866
 *     return f"<{self.far_type()} FarReader at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def open(cls, *sources):
 *     """
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_5open, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_open, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[166])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_open, __pyx_t_5) < 0) __PYX_ERR(0, 4866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GetNameInClass(__pyx_t_5, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_open); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 4866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_open, __pyx_t_7) < 0) __PYX_ERR(0, 4866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4895
 *     return reader
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_7arc_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_arc_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[167])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_arc_type, __pyx_t_7) < 0) __PYX_ERR(0, 4895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4904
 *       return self._reader.get().ArcType()
 * 
 *   cpdef bool done(self):             # <<<<<<<<<<<<<<
 *     """
 *     done(self)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_9done, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_done, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[168])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4904, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_done, __pyx_t_7) < 0) __PYX_ERR(0, 4904, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4916
 *       return self._reader.get().Done()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_11error, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_error, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[169])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_error, __pyx_t_7) < 0) __PYX_ERR(0, 4916, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4927
 *     return self._reader.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     with nogil:
 *       return fst.GetFarTypeString(self._reader.get().Type())
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_13far_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_far_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[170])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_far_type, __pyx_t_7) < 0) __PYX_ERR(0, 4927, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4931
 *       return fst.GetFarTypeString(self._reader.get().Type())
 * 
 *   cpdef bool find(self, key):             # <<<<<<<<<<<<<<
 *     """
 *     find(self, key)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_15find, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_find, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[171])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_find, __pyx_t_7) < 0) __PYX_ERR(0, 4931, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4948
 *       return self._reader.get().Find(_key)
 * 
 *   cpdef Fst get_fst(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_fst(self)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_17get_fst, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_get_fst, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[172])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_get_fst, __pyx_t_7) < 0) __PYX_ERR(0, 4948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4962
 *     return _init_XFst(_tfst.release())
 * 
 *   cpdef string get_key(self):             # <<<<<<<<<<<<<<
 *     """
 *     get_key(self)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_19get_key, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_get_key, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[173])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_get_key, __pyx_t_7) < 0) __PYX_ERR(0, 4962, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4974
 *       return self._reader.get().GetKey()
 * 
 *   cpdef void next(self):             # <<<<<<<<<<<<<<
 *     """
 *     next(self)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_21next, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_next, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[174])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4974, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_next, __pyx_t_7) < 0) __PYX_ERR(0, 4974, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":4983
 *       self._reader.get().Next()
 * 
 *   cpdef void reset(self):             # <<<<<<<<<<<<<<
 *     """
 *     reset(self)
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_23reset, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader_reset, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[175])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 4983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarReader, __pyx_mstate_global->__pyx_n_u_reset, __pyx_t_7) < 0) __PYX_ERR(0, 4983, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(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):
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_31__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[176])); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "(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"
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarReader_33__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarReader___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[177])); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "pywrapfst.pyx":5036
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def create(cls, source, arc_type="standard", far_type="default"):
 *     """
*/
  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarWriter_5create, __Pyx_CYFUNCTION_CLASSMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarWriter_create, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[178])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_mstate_global->__pyx_tuple[16]);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_7) < 0) __PYX_ERR(0, 5036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_GetNameInClass(__pyx_t_7, (PyObject*)__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter, __pyx_mstate_global->__pyx_n_u_create); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 5036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter, __pyx_mstate_global->__pyx_n_u_create, __pyx_t_5) < 0) __PYX_ERR(0, 5036, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":5081
 *     self._writer.reset()
 * 
 *   cpdef void add(self, key, Fst ifst) except *:             # <<<<<<<<<<<<<<
 *     """
 *     add(self, key, ifst)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarWriter_7add, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarWriter_add, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[179])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5081, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter, __pyx_mstate_global->__pyx_n_u_add, __pyx_t_5) < 0) __PYX_ERR(0, 5081, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":5106
 *       raise FstOpError("Incompatible or invalid arc type")
 * 
 *   cpdef string arc_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     arc_type(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarWriter_9arc_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarWriter_arc_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[180])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter, __pyx_mstate_global->__pyx_n_u_arc_type, __pyx_t_5) < 0) __PYX_ERR(0, 5106, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":5115
 *       return self._writer.get().ArcType()
 * 
 *   cpdef bool error(self):             # <<<<<<<<<<<<<<
 *     """
 *     error(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarWriter_11error, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarWriter_error, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[181])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter, __pyx_mstate_global->__pyx_n_u_error, __pyx_t_5) < 0) __PYX_ERR(0, 5115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":5127
 *       return self._writer.get().Error()
 * 
 *   cpdef string far_type(self):             # <<<<<<<<<<<<<<
 *     """
 *     far_type(self)
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarWriter_13far_type, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarWriter_far_type, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[182])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 5127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_9pywrapfst_FarWriter, __pyx_mstate_global->__pyx_n_u_far_type, __pyx_t_5) < 0) __PYX_ERR(0, 5127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(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):
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarWriter_17__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarWriter___reduce_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[183])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_reduce_cython, __pyx_t_5) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "(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"
*/
  __pyx_t_5 = __Pyx_CyFunction_New(&__pyx_mdef_9pywrapfst_9FarWriter_19__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_FarWriter___setstate_cython, NULL, __pyx_mstate_global->__pyx_n_u_pywrapfst_2, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[184])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_setstate_cython, __pyx_t_5) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "pywrapfst.pyx":5142
 * 
 * # Masks fst_error_fatal in-module.
 * fst.FST_FLAGS_fst_error_fatal = False             # <<<<<<<<<<<<<<
*/
  FST_FLAGS_fst_error_fatal = 0;

  /* "pywrapfst.pyx":1
 * #cython: c_string_encoding=utf8, c_string_type=unicode, language_level=3, nonecheck=True             # <<<<<<<<<<<<<<
 * # Copyright 2005-2024 Google LLC
 * #
*/
  __pyx_t_5 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test_2, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

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

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  if (__pyx_m) {
    if (__pyx_mstate->__pyx_d && stringtab_initialized) {
      __Pyx_AddTraceback("init pywrapfst", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_USE_MODULE_STATE
    Py_CLEAR(__pyx_m);
    #else
    Py_DECREF(__pyx_m);
    if (pystate_addmodule_run) {
      PyObject *tp, *value, *tb;
      PyErr_Fetch(&tp, &value, &tb);
      PyState_RemoveModule(&__pyx_moduledef);
      PyErr_Restore(tp, value, tb);
    }
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pywrapfst");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #else
  return __pyx_m;
  #endif
}
/* #### Code section: pystring_table ### */

typedef struct {
    const char *s;
#if 375 <= 65535
    const unsigned short n;
#elif 375 / 2 < INT_MAX
    const unsigned int n;
#elif 375 / 2 < LONG_MAX
    const unsigned long n;
#else
    const Py_ssize_t n;
#endif
#if 1 <= 31
    const unsigned int encoding : 5;
#elif 1 <= 255
    const unsigned char encoding;
#elif 1 <= 65535
    const unsigned short encoding;
#else
    const Py_ssize_t encoding;
#endif
    const unsigned int is_unicode : 1;
    const unsigned int intern : 1;
} __Pyx_StringTabEntry;
static const char * const __pyx_string_tab_encodings[] = { 0 };
static const __Pyx_StringTabEntry __pyx_string_tab[] = {
  {__pyx_k_, sizeof(__pyx_k_), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ */
  {__pyx_k_ACCEPTOR, sizeof(__pyx_k_ACCEPTOR), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ACCEPTOR */
  {__pyx_k_ACCESSIBLE, sizeof(__pyx_k_ACCESSIBLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ACCESSIBLE */
  {__pyx_k_ACYCLIC, sizeof(__pyx_k_ACYCLIC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ACYCLIC */
  {__pyx_k_ADD_ARC_PROPERTIES, sizeof(__pyx_k_ADD_ARC_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ADD_ARC_PROPERTIES */
  {__pyx_k_ADD_STATE_PROPERTIES, sizeof(__pyx_k_ADD_STATE_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ADD_STATE_PROPERTIES */
  {__pyx_k_ADD_SUPERFINAL_PROPERTIES, sizeof(__pyx_k_ADD_SUPERFINAL_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ADD_SUPERFINAL_PROPERTIES */
  {__pyx_k_ARC_FLAGS, sizeof(__pyx_k_ARC_FLAGS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ARC_FLAGS */
  {__pyx_k_ARC_I_LABEL_VALUE, sizeof(__pyx_k_ARC_I_LABEL_VALUE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ARC_I_LABEL_VALUE */
  {__pyx_k_ARC_NEXT_STATE_VALUE, sizeof(__pyx_k_ARC_NEXT_STATE_VALUE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ARC_NEXT_STATE_VALUE */
  {__pyx_k_ARC_NO_CACHE, sizeof(__pyx_k_ARC_NO_CACHE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ARC_NO_CACHE */
  {__pyx_k_ARC_O_LABEL_VALUE, sizeof(__pyx_k_ARC_O_LABEL_VALUE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ARC_O_LABEL_VALUE */
  {__pyx_k_ARC_SORT_PROPERTIES, sizeof(__pyx_k_ARC_SORT_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ARC_SORT_PROPERTIES */
  {__pyx_k_ARC_VALUE_FLAGS, sizeof(__pyx_k_ARC_VALUE_FLAGS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ARC_VALUE_FLAGS */
  {__pyx_k_ARC_WEIGHT_VALUE, sizeof(__pyx_k_ARC_WEIGHT_VALUE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ARC_WEIGHT_VALUE */
  {__pyx_k_Arc, sizeof(__pyx_k_Arc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Arc */
  {__pyx_k_ArcIterator, sizeof(__pyx_k_ArcIterator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator */
  {__pyx_k_ArcIteratorFlags, sizeof(__pyx_k_ArcIteratorFlags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIteratorFlags */
  {__pyx_k_ArcIterator___reduce_cython, sizeof(__pyx_k_ArcIterator___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator___reduce_cython */
  {__pyx_k_ArcIterator___setstate_cython, sizeof(__pyx_k_ArcIterator___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator___setstate_cython */
  {__pyx_k_ArcIterator_at_0x, sizeof(__pyx_k_ArcIterator_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_ArcIterator_at_0x */
  {__pyx_k_ArcIterator_done, sizeof(__pyx_k_ArcIterator_done), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator_done */
  {__pyx_k_ArcIterator_flags, sizeof(__pyx_k_ArcIterator_flags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator_flags */
  {__pyx_k_ArcIterator_next, sizeof(__pyx_k_ArcIterator_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator_next */
  {__pyx_k_ArcIterator_position, sizeof(__pyx_k_ArcIterator_position), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator_position */
  {__pyx_k_ArcIterator_reset, sizeof(__pyx_k_ArcIterator_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator_reset */
  {__pyx_k_ArcIterator_seek, sizeof(__pyx_k_ArcIterator_seek), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator_seek */
  {__pyx_k_ArcIterator_set_flags, sizeof(__pyx_k_ArcIterator_set_flags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator_set_flags */
  {__pyx_k_ArcIterator_value, sizeof(__pyx_k_ArcIterator_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcIterator_value */
  {__pyx_k_ArcMapType, sizeof(__pyx_k_ArcMapType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ArcMapType */
  {__pyx_k_Arc___reduce_cython, sizeof(__pyx_k_Arc___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Arc___reduce_cython */
  {__pyx_k_Arc___setstate_cython, sizeof(__pyx_k_Arc___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Arc___setstate_cython */
  {__pyx_k_Arc_at_0x, sizeof(__pyx_k_Arc_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Arc_at_0x */
  {__pyx_k_Arc_copy, sizeof(__pyx_k_Arc_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Arc_copy */
  {__pyx_k_Argument_FST_did_not_satisfy_pre, sizeof(__pyx_k_Argument_FST_did_not_satisfy_pre), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Argument_FST_did_not_satisfy_pre */
  {__pyx_k_BINARY_PROPERTIES, sizeof(__pyx_k_BINARY_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_BINARY_PROPERTIES */
  {__pyx_k_COACCESSIBLE, sizeof(__pyx_k_COACCESSIBLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_COACCESSIBLE */
  {__pyx_k_COMMUTATIVE, sizeof(__pyx_k_COMMUTATIVE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_COMMUTATIVE */
  {__pyx_k_COPY_PROPERTIES, sizeof(__pyx_k_COPY_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_COPY_PROPERTIES */
  {__pyx_k_CYCLIC, sizeof(__pyx_k_CYCLIC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_CYCLIC */
  {__pyx_k_Call, sizeof(__pyx_k_Call), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Call */
  {__pyx_k_Can_t_get_value_from_an_exhauste, sizeof(__pyx_k_Can_t_get_value_from_an_exhauste), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_t_get_value_from_an_exhauste */
  {__pyx_k_Can_t_set_value_on_an_exhausted, sizeof(__pyx_k_Can_t_set_value_on_an_exhausted), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Can_t_set_value_on_an_exhausted */
  {__pyx_k_Cannot_construct, sizeof(__pyx_k_Cannot_construct), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cannot_construct */
  {__pyx_k_Cannot_topsort_cyclic_FST, sizeof(__pyx_k_Cannot_topsort_cyclic_FST), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Cannot_topsort_cyclic_FST */
  {__pyx_k_ClosureType, sizeof(__pyx_k_ClosureType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ClosureType */
  {__pyx_k_Compilation_failed, sizeof(__pyx_k_Compilation_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Compilation_failed */
  {__pyx_k_Compiler, sizeof(__pyx_k_Compiler), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compiler */
  {__pyx_k_Compiler___reduce_cython, sizeof(__pyx_k_Compiler___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compiler___reduce_cython */
  {__pyx_k_Compiler___setstate_cython, sizeof(__pyx_k_Compiler___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compiler___setstate_cython */
  {__pyx_k_Compiler_compile, sizeof(__pyx_k_Compiler_compile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compiler_compile */
  {__pyx_k_Compiler_write, sizeof(__pyx_k_Compiler_write), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Compiler_write */
  {__pyx_k_ComposeFilter, sizeof(__pyx_k_ComposeFilter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ComposeFilter */
  {__pyx_k_Conversion_to, sizeof(__pyx_k_Conversion_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Conversion_to */
  {__pyx_k_DELETE_ARC_PROPERTIES, sizeof(__pyx_k_DELETE_ARC_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DELETE_ARC_PROPERTIES */
  {__pyx_k_DELETE_STATE_PROPERTIES, sizeof(__pyx_k_DELETE_STATE_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DELETE_STATE_PROPERTIES */
  {__pyx_k_DeterminizeType, sizeof(__pyx_k_DeterminizeType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DeterminizeType */
  {__pyx_k_DisplayToast, sizeof(__pyx_k_DisplayToast), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DisplayToast */
  {__pyx_k_Dot_rendering_failed_s, sizeof(__pyx_k_Dot_rendering_failed_s), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Dot_rendering_failed_s */
  {__pyx_k_DrawFloatFormat, sizeof(__pyx_k_DrawFloatFormat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_DrawFloatFormat */
  {__pyx_k_ENCODE_FLAGS, sizeof(__pyx_k_ENCODE_FLAGS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ENCODE_FLAGS */
  {__pyx_k_ENCODE_LABELS, sizeof(__pyx_k_ENCODE_LABELS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ENCODE_LABELS */
  {__pyx_k_ENCODE_WEIGHTS, sizeof(__pyx_k_ENCODE_WEIGHTS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ENCODE_WEIGHTS */
  {__pyx_k_EPSILONS, sizeof(__pyx_k_EPSILONS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EPSILONS */
  {__pyx_k_ERROR, sizeof(__pyx_k_ERROR), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ERROR */
  {__pyx_k_EXPANDED, sizeof(__pyx_k_EXPANDED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EXPANDED */
  {__pyx_k_EXTRINSIC_PROPERTIES, sizeof(__pyx_k_EXTRINSIC_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EXTRINSIC_PROPERTIES */
  {__pyx_k_EncodeMapper, sizeof(__pyx_k_EncodeMapper), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper */
  {__pyx_k_EncodeMapperFlags, sizeof(__pyx_k_EncodeMapperFlags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapperFlags */
  {__pyx_k_EncodeMapperSymbolTableView, sizeof(__pyx_k_EncodeMapperSymbolTableView), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapperSymbolTableView */
  {__pyx_k_EncodeMapper___reduce, sizeof(__pyx_k_EncodeMapper___reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper___reduce */
  {__pyx_k_EncodeMapper_arc_type, sizeof(__pyx_k_EncodeMapper_arc_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_arc_type */
  {__pyx_k_EncodeMapper_at_0x, sizeof(__pyx_k_EncodeMapper_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_EncodeMapper_at_0x */
  {__pyx_k_EncodeMapper_flags, sizeof(__pyx_k_EncodeMapper_flags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_flags */
  {__pyx_k_EncodeMapper_input_symbols, sizeof(__pyx_k_EncodeMapper_input_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_input_symbols */
  {__pyx_k_EncodeMapper_output_symbols, sizeof(__pyx_k_EncodeMapper_output_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_output_symbols */
  {__pyx_k_EncodeMapper_properties, sizeof(__pyx_k_EncodeMapper_properties), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_properties */
  {__pyx_k_EncodeMapper_read, sizeof(__pyx_k_EncodeMapper_read), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_read */
  {__pyx_k_EncodeMapper_read_from_string, sizeof(__pyx_k_EncodeMapper_read_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_read_from_string */
  {__pyx_k_EncodeMapper_set_input_symbols, sizeof(__pyx_k_EncodeMapper_set_input_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_set_input_symbols */
  {__pyx_k_EncodeMapper_set_output_symbols, sizeof(__pyx_k_EncodeMapper_set_output_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_set_output_symbols */
  {__pyx_k_EncodeMapper_weight_type, sizeof(__pyx_k_EncodeMapper_weight_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_weight_type */
  {__pyx_k_EncodeMapper_write, sizeof(__pyx_k_EncodeMapper_write), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_write */
  {__pyx_k_EncodeMapper_write_to_string, sizeof(__pyx_k_EncodeMapper_write_to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EncodeMapper_write_to_string */
  {__pyx_k_EpsNormalizeType, sizeof(__pyx_k_EpsNormalizeType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_EpsNormalizeType */
  {__pyx_k_Expected, sizeof(__pyx_k_Expected), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Expected */
  {__pyx_k_FST_PROPERTIES, sizeof(__pyx_k_FST_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FST_PROPERTIES */
  {__pyx_k_FarReader, sizeof(__pyx_k_FarReader), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader */
  {__pyx_k_FarReader___reduce_cython, sizeof(__pyx_k_FarReader___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader___reduce_cython */
  {__pyx_k_FarReader___setstate_cython, sizeof(__pyx_k_FarReader___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader___setstate_cython */
  {__pyx_k_FarReader_arc_type, sizeof(__pyx_k_FarReader_arc_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_arc_type */
  {__pyx_k_FarReader_at_0x, sizeof(__pyx_k_FarReader_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_FarReader_at_0x */
  {__pyx_k_FarReader_done, sizeof(__pyx_k_FarReader_done), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_done */
  {__pyx_k_FarReader_error, sizeof(__pyx_k_FarReader_error), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_error */
  {__pyx_k_FarReader_far_type, sizeof(__pyx_k_FarReader_far_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_far_type */
  {__pyx_k_FarReader_find, sizeof(__pyx_k_FarReader_find), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_find */
  {__pyx_k_FarReader_get_fst, sizeof(__pyx_k_FarReader_get_fst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_get_fst */
  {__pyx_k_FarReader_get_key, sizeof(__pyx_k_FarReader_get_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_get_key */
  {__pyx_k_FarReader_next, sizeof(__pyx_k_FarReader_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_next */
  {__pyx_k_FarReader_open, sizeof(__pyx_k_FarReader_open), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_open */
  {__pyx_k_FarReader_reset, sizeof(__pyx_k_FarReader_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarReader_reset */
  {__pyx_k_FarType, sizeof(__pyx_k_FarType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarType */
  {__pyx_k_FarWriter, sizeof(__pyx_k_FarWriter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarWriter */
  {__pyx_k_FarWriter___reduce_cython, sizeof(__pyx_k_FarWriter___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarWriter___reduce_cython */
  {__pyx_k_FarWriter___setstate_cython, sizeof(__pyx_k_FarWriter___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarWriter___setstate_cython */
  {__pyx_k_FarWriter_add, sizeof(__pyx_k_FarWriter_add), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarWriter_add */
  {__pyx_k_FarWriter_arc_type, sizeof(__pyx_k_FarWriter_arc_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarWriter_arc_type */
  {__pyx_k_FarWriter_at_0x, sizeof(__pyx_k_FarWriter_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_FarWriter_at_0x */
  {__pyx_k_FarWriter_create, sizeof(__pyx_k_FarWriter_create), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarWriter_create */
  {__pyx_k_FarWriter_error, sizeof(__pyx_k_FarWriter_error), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarWriter_error */
  {__pyx_k_FarWriter_far_type, sizeof(__pyx_k_FarWriter_far_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FarWriter_far_type */
  {__pyx_k_Flag, sizeof(__pyx_k_Flag), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Flag */
  {__pyx_k_Fst, sizeof(__pyx_k_Fst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst */
  {__pyx_k_FstArgError, sizeof(__pyx_k_FstArgError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FstArgError */
  {__pyx_k_FstBadWeightError, sizeof(__pyx_k_FstBadWeightError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FstBadWeightError */
  {__pyx_k_FstError, sizeof(__pyx_k_FstError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FstError */
  {__pyx_k_FstIOError, sizeof(__pyx_k_FstIOError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FstIOError */
  {__pyx_k_FstIndexError, sizeof(__pyx_k_FstIndexError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FstIndexError */
  {__pyx_k_FstOpError, sizeof(__pyx_k_FstOpError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FstOpError */
  {__pyx_k_FstProperties, sizeof(__pyx_k_FstProperties), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FstProperties */
  {__pyx_k_FstSymbolTableView, sizeof(__pyx_k_FstSymbolTableView), 0, 1, 1}, /* PyObject cname: __pyx_n_u_FstSymbolTableView */
  {__pyx_k_Fst_SymbolTableView, sizeof(__pyx_k_Fst_SymbolTableView), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Fst_SymbolTableView */
  {__pyx_k_Fst___reduce, sizeof(__pyx_k_Fst___reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst___reduce */
  {__pyx_k_Fst__repr_svg, sizeof(__pyx_k_Fst__repr_svg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst__repr_svg */
  {__pyx_k_Fst_arc_type, sizeof(__pyx_k_Fst_arc_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_arc_type */
  {__pyx_k_Fst_arcs, sizeof(__pyx_k_Fst_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_arcs */
  {__pyx_k_Fst_at_0x, sizeof(__pyx_k_Fst_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Fst_at_0x */
  {__pyx_k_Fst_copy, sizeof(__pyx_k_Fst_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_copy */
  {__pyx_k_Fst_draw, sizeof(__pyx_k_Fst_draw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_draw */
  {__pyx_k_Fst_final, sizeof(__pyx_k_Fst_final), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_final */
  {__pyx_k_Fst_fst_type, sizeof(__pyx_k_Fst_fst_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_fst_type */
  {__pyx_k_Fst_input_symbols, sizeof(__pyx_k_Fst_input_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_input_symbols */
  {__pyx_k_Fst_num_arcs, sizeof(__pyx_k_Fst_num_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_num_arcs */
  {__pyx_k_Fst_num_input_epsilons, sizeof(__pyx_k_Fst_num_input_epsilons), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_num_input_epsilons */
  {__pyx_k_Fst_num_output_epsilons, sizeof(__pyx_k_Fst_num_output_epsilons), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_num_output_epsilons */
  {__pyx_k_Fst_num_states_if_known, sizeof(__pyx_k_Fst_num_states_if_known), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_num_states_if_known */
  {__pyx_k_Fst_output_symbols, sizeof(__pyx_k_Fst_output_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_output_symbols */
  {__pyx_k_Fst_print, sizeof(__pyx_k_Fst_print), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_print */
  {__pyx_k_Fst_properties, sizeof(__pyx_k_Fst_properties), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_properties */
  {__pyx_k_Fst_read, sizeof(__pyx_k_Fst_read), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_read */
  {__pyx_k_Fst_read_from_string, sizeof(__pyx_k_Fst_read_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_read_from_string */
  {__pyx_k_Fst_start, sizeof(__pyx_k_Fst_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_start */
  {__pyx_k_Fst_states, sizeof(__pyx_k_Fst_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_states */
  {__pyx_k_Fst_verify, sizeof(__pyx_k_Fst_verify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_verify */
  {__pyx_k_Fst_weight_type, sizeof(__pyx_k_Fst_weight_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_weight_type */
  {__pyx_k_Fst_write, sizeof(__pyx_k_Fst_write), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_write */
  {__pyx_k_Fst_write_to_string, sizeof(__pyx_k_Fst_write_to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Fst_write_to_string */
  {__pyx_k_GraphViz_server_request_failed, sizeof(__pyx_k_GraphViz_server_request_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_GraphViz_server_request_failed */
  {__pyx_k_Graphviz_server_requested_failed, sizeof(__pyx_k_Graphviz_server_requested_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Graphviz_server_requested_failed */
  {__pyx_k_IDEMPOTENT, sizeof(__pyx_k_IDEMPOTENT), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IDEMPOTENT */
  {__pyx_k_INITIAL_ACYCLIC, sizeof(__pyx_k_INITIAL_ACYCLIC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_INITIAL_ACYCLIC */
  {__pyx_k_INITIAL_CYCLIC, sizeof(__pyx_k_INITIAL_CYCLIC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_INITIAL_CYCLIC */
  {__pyx_k_INTRINSIC_PROPERTIES, sizeof(__pyx_k_INTRINSIC_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_INTRINSIC_PROPERTIES */
  {__pyx_k_IOError, sizeof(__pyx_k_IOError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IOError */
  {__pyx_k_I_DETERMINISTIC, sizeof(__pyx_k_I_DETERMINISTIC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_I_DETERMINISTIC */
  {__pyx_k_I_EPSILONS, sizeof(__pyx_k_I_EPSILONS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_I_EPSILONS */
  {__pyx_k_I_LABEL_INVARIANT_PROPERTIES, sizeof(__pyx_k_I_LABEL_INVARIANT_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_I_LABEL_INVARIANT_PROPERTIES */
  {__pyx_k_I_LABEL_SORTED, sizeof(__pyx_k_I_LABEL_SORTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_I_LABEL_SORTED */
  {__pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ImportError */
  {__pyx_k_Incompatible_or_invalid_arc_type, sizeof(__pyx_k_Incompatible_or_invalid_arc_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_or_invalid_arc_type */
  {__pyx_k_Incompatible_or_invalid_weight, sizeof(__pyx_k_Incompatible_or_invalid_weight), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_or_invalid_weight */
  {__pyx_k_Incompatible_or_invalid_weight_t, sizeof(__pyx_k_Incompatible_or_invalid_weight_t), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Incompatible_or_invalid_weight_t */
  {__pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_IndexError */
  {__pyx_k_Invalid_weight, sizeof(__pyx_k_Invalid_weight), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Invalid_weight */
  {__pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_KeyError */
  {__pyx_k_LEFT_SEMIRING, sizeof(__pyx_k_LEFT_SEMIRING), 0, 1, 1}, /* PyObject cname: __pyx_n_u_LEFT_SEMIRING */
  {__pyx_k_Literal_star_plus, sizeof(__pyx_k_Literal_star_plus), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Literal_star_plus */
  {__pyx_k_MUTABLE, sizeof(__pyx_k_MUTABLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MUTABLE */
  {__pyx_k_MutableArcIterator, sizeof(__pyx_k_MutableArcIterator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator */
  {__pyx_k_MutableArcIterator___reduce_cyt, sizeof(__pyx_k_MutableArcIterator___reduce_cyt), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator___reduce_cyt */
  {__pyx_k_MutableArcIterator___setstate_c, sizeof(__pyx_k_MutableArcIterator___setstate_c), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator___setstate_c */
  {__pyx_k_MutableArcIterator_at_0x, sizeof(__pyx_k_MutableArcIterator_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_MutableArcIterator_at_0x */
  {__pyx_k_MutableArcIterator_done, sizeof(__pyx_k_MutableArcIterator_done), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_done */
  {__pyx_k_MutableArcIterator_flags, sizeof(__pyx_k_MutableArcIterator_flags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_flags */
  {__pyx_k_MutableArcIterator_next, sizeof(__pyx_k_MutableArcIterator_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_next */
  {__pyx_k_MutableArcIterator_position, sizeof(__pyx_k_MutableArcIterator_position), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_position */
  {__pyx_k_MutableArcIterator_reset, sizeof(__pyx_k_MutableArcIterator_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_reset */
  {__pyx_k_MutableArcIterator_seek, sizeof(__pyx_k_MutableArcIterator_seek), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_seek */
  {__pyx_k_MutableArcIterator_set_flags, sizeof(__pyx_k_MutableArcIterator_set_flags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_set_flags */
  {__pyx_k_MutableArcIterator_set_value, sizeof(__pyx_k_MutableArcIterator_set_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_set_value */
  {__pyx_k_MutableArcIterator_value, sizeof(__pyx_k_MutableArcIterator_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableArcIterator_value */
  {__pyx_k_MutableFst, sizeof(__pyx_k_MutableFst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst */
  {__pyx_k_MutableFstSymbolTableView, sizeof(__pyx_k_MutableFstSymbolTableView), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFstSymbolTableView */
  {__pyx_k_MutableFst_add_arc, sizeof(__pyx_k_MutableFst_add_arc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_add_arc */
  {__pyx_k_MutableFst_add_state, sizeof(__pyx_k_MutableFst_add_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_add_state */
  {__pyx_k_MutableFst_add_states, sizeof(__pyx_k_MutableFst_add_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_add_states */
  {__pyx_k_MutableFst_arcsort, sizeof(__pyx_k_MutableFst_arcsort), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_arcsort */
  {__pyx_k_MutableFst_closure, sizeof(__pyx_k_MutableFst_closure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_closure */
  {__pyx_k_MutableFst_concat, sizeof(__pyx_k_MutableFst_concat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_concat */
  {__pyx_k_MutableFst_connect, sizeof(__pyx_k_MutableFst_connect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_connect */
  {__pyx_k_MutableFst_decode, sizeof(__pyx_k_MutableFst_decode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_decode */
  {__pyx_k_MutableFst_delete_arcs, sizeof(__pyx_k_MutableFst_delete_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_delete_arcs */
  {__pyx_k_MutableFst_delete_states, sizeof(__pyx_k_MutableFst_delete_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_delete_states */
  {__pyx_k_MutableFst_encode, sizeof(__pyx_k_MutableFst_encode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_encode */
  {__pyx_k_MutableFst_invert, sizeof(__pyx_k_MutableFst_invert), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_invert */
  {__pyx_k_MutableFst_minimize, sizeof(__pyx_k_MutableFst_minimize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_minimize */
  {__pyx_k_MutableFst_mutable_arcs, sizeof(__pyx_k_MutableFst_mutable_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_mutable_arcs */
  {__pyx_k_MutableFst_mutable_input_symbols, sizeof(__pyx_k_MutableFst_mutable_input_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_mutable_input_symbols */
  {__pyx_k_MutableFst_mutable_output_symbol, sizeof(__pyx_k_MutableFst_mutable_output_symbol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_mutable_output_symbol */
  {__pyx_k_MutableFst_num_states, sizeof(__pyx_k_MutableFst_num_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_num_states */
  {__pyx_k_MutableFst_project, sizeof(__pyx_k_MutableFst_project), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_project */
  {__pyx_k_MutableFst_prune, sizeof(__pyx_k_MutableFst_prune), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_prune */
  {__pyx_k_MutableFst_push, sizeof(__pyx_k_MutableFst_push), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_push */
  {__pyx_k_MutableFst_relabel_pairs, sizeof(__pyx_k_MutableFst_relabel_pairs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_relabel_pairs */
  {__pyx_k_MutableFst_relabel_tables, sizeof(__pyx_k_MutableFst_relabel_tables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_relabel_tables */
  {__pyx_k_MutableFst_reserve_arcs, sizeof(__pyx_k_MutableFst_reserve_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_reserve_arcs */
  {__pyx_k_MutableFst_reserve_states, sizeof(__pyx_k_MutableFst_reserve_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_reserve_states */
  {__pyx_k_MutableFst_reweight, sizeof(__pyx_k_MutableFst_reweight), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_reweight */
  {__pyx_k_MutableFst_rmepsilon, sizeof(__pyx_k_MutableFst_rmepsilon), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_rmepsilon */
  {__pyx_k_MutableFst_set_final, sizeof(__pyx_k_MutableFst_set_final), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_set_final */
  {__pyx_k_MutableFst_set_input_symbols, sizeof(__pyx_k_MutableFst_set_input_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_set_input_symbols */
  {__pyx_k_MutableFst_set_output_symbols, sizeof(__pyx_k_MutableFst_set_output_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_set_output_symbols */
  {__pyx_k_MutableFst_set_properties, sizeof(__pyx_k_MutableFst_set_properties), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_set_properties */
  {__pyx_k_MutableFst_set_start, sizeof(__pyx_k_MutableFst_set_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_set_start */
  {__pyx_k_MutableFst_topsort, sizeof(__pyx_k_MutableFst_topsort), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_topsort */
  {__pyx_k_MutableFst_union, sizeof(__pyx_k_MutableFst_union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableFst_union */
  {__pyx_k_MutableSymbolTable, sizeof(__pyx_k_MutableSymbolTable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableSymbolTable */
  {__pyx_k_MutableSymbolTable_add_symbol, sizeof(__pyx_k_MutableSymbolTable_add_symbol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableSymbolTable_add_symbol */
  {__pyx_k_MutableSymbolTable_add_table, sizeof(__pyx_k_MutableSymbolTable_add_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableSymbolTable_add_table */
  {__pyx_k_MutableSymbolTable_set_name, sizeof(__pyx_k_MutableSymbolTable_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_MutableSymbolTable_set_name */
  {__pyx_k_NEG_TRINARY_PROPERTIES, sizeof(__pyx_k_NEG_TRINARY_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NEG_TRINARY_PROPERTIES */
  {__pyx_k_NON_I_DETERMINISTIC, sizeof(__pyx_k_NON_I_DETERMINISTIC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NON_I_DETERMINISTIC */
  {__pyx_k_NON_O_DETERMINISTIC, sizeof(__pyx_k_NON_O_DETERMINISTIC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NON_O_DETERMINISTIC */
  {__pyx_k_NOT_ACCEPTOR, sizeof(__pyx_k_NOT_ACCEPTOR), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NOT_ACCEPTOR */
  {__pyx_k_NOT_ACCESSIBLE, sizeof(__pyx_k_NOT_ACCESSIBLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NOT_ACCESSIBLE */
  {__pyx_k_NOT_COACCESSIBLE, sizeof(__pyx_k_NOT_COACCESSIBLE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NOT_COACCESSIBLE */
  {__pyx_k_NOT_I_LABEL_SORTED, sizeof(__pyx_k_NOT_I_LABEL_SORTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NOT_I_LABEL_SORTED */
  {__pyx_k_NOT_O_LABEL_SORTED, sizeof(__pyx_k_NOT_O_LABEL_SORTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NOT_O_LABEL_SORTED */
  {__pyx_k_NOT_STRING, sizeof(__pyx_k_NOT_STRING), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NOT_STRING */
  {__pyx_k_NOT_TOP_SORTED, sizeof(__pyx_k_NOT_TOP_SORTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NOT_TOP_SORTED */
  {__pyx_k_NO_EPSILONS, sizeof(__pyx_k_NO_EPSILONS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NO_EPSILONS */
  {__pyx_k_NO_I_EPSILONS, sizeof(__pyx_k_NO_I_EPSILONS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NO_I_EPSILONS */
  {__pyx_k_NO_LABEL, sizeof(__pyx_k_NO_LABEL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NO_LABEL */
  {__pyx_k_NO_O_EPSILONS, sizeof(__pyx_k_NO_O_EPSILONS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NO_O_EPSILONS */
  {__pyx_k_NO_STATE_ID, sizeof(__pyx_k_NO_STATE_ID), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NO_STATE_ID */
  {__pyx_k_NO_SYMBOL, sizeof(__pyx_k_NO_SYMBOL), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NO_SYMBOL */
  {__pyx_k_NULL_PROPERTIES, sizeof(__pyx_k_NULL_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NULL_PROPERTIES */
  {__pyx_k_No_new_SymbolTables_specified, sizeof(__pyx_k_No_new_SymbolTables_specified), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_No_new_SymbolTables_specified */
  {__pyx_k_No_relabeling_pairs_specified, sizeof(__pyx_k_No_relabeling_pairs_specified), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_No_relabeling_pairs_specified */
  {__pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_NotImplementedError */
  {__pyx_k_Note_that_Cython_is_deliberately, sizeof(__pyx_k_Note_that_Cython_is_deliberately), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Note_that_Cython_is_deliberately */
  {__pyx_k_Number, sizeof(__pyx_k_Number), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Number */
  {__pyx_k_O_DETERMINISTIC, sizeof(__pyx_k_O_DETERMINISTIC), 0, 1, 1}, /* PyObject cname: __pyx_n_u_O_DETERMINISTIC */
  {__pyx_k_O_EPSILONS, sizeof(__pyx_k_O_EPSILONS), 0, 1, 1}, /* PyObject cname: __pyx_n_u_O_EPSILONS */
  {__pyx_k_O_LABEL_INVARIANT_PROPERTIES, sizeof(__pyx_k_O_LABEL_INVARIANT_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_O_LABEL_INVARIANT_PROPERTIES */
  {__pyx_k_O_LABEL_SORTED, sizeof(__pyx_k_O_LABEL_SORTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_O_LABEL_SORTED */
  {__pyx_k_Open_failed, sizeof(__pyx_k_Open_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Open_failed */
  {__pyx_k_Operation_failed, sizeof(__pyx_k_Operation_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Operation_failed */
  {__pyx_k_PATH, sizeof(__pyx_k_PATH), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PATH */
  {__pyx_k_PIPE, sizeof(__pyx_k_PIPE), 0, 1, 1}, /* PyObject cname: __pyx_n_u_PIPE */
  {__pyx_k_POS_TRINARY_PROPERTIES, sizeof(__pyx_k_POS_TRINARY_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_POS_TRINARY_PROPERTIES */
  {__pyx_k_Popen, sizeof(__pyx_k_Popen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Popen */
  {__pyx_k_ProjectType, sizeof(__pyx_k_ProjectType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ProjectType */
  {__pyx_k_QueueType, sizeof(__pyx_k_QueueType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_QueueType */
  {__pyx_k_RIGHT_SEMIRING, sizeof(__pyx_k_RIGHT_SEMIRING), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RIGHT_SEMIRING */
  {__pyx_k_RM_SUPERFINAL_PROPERTIES, sizeof(__pyx_k_RM_SUPERFINAL_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RM_SUPERFINAL_PROPERTIES */
  {__pyx_k_RandArcSelection, sizeof(__pyx_k_RandArcSelection), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RandArcSelection */
  {__pyx_k_Read_failed, sizeof(__pyx_k_Read_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Read_failed */
  {__pyx_k_Read_from_FST_failed, sizeof(__pyx_k_Read_from_FST_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Read_from_FST_failed */
  {__pyx_k_Read_from_string_failed, sizeof(__pyx_k_Read_from_string_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Read_from_string_failed */
  {__pyx_k_RenderRequest, sizeof(__pyx_k_RenderRequest), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RenderRequest */
  {__pyx_k_RenderServer_Render, sizeof(__pyx_k_RenderServer_Render), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_RenderServer_Render */
  {__pyx_k_ReplaceLabelType, sizeof(__pyx_k_ReplaceLabelType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ReplaceLabelType */
  {__pyx_k_ReweightType, sizeof(__pyx_k_ReweightType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ReweightType */
  {__pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_RuntimeError */
  {__pyx_k_SEMIRING, sizeof(__pyx_k_SEMIRING), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SEMIRING */
  {__pyx_k_SET_ARC_PROPERTIES, sizeof(__pyx_k_SET_ARC_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SET_ARC_PROPERTIES */
  {__pyx_k_SET_FINAL_PROPERTIES, sizeof(__pyx_k_SET_FINAL_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SET_FINAL_PROPERTIES */
  {__pyx_k_SET_START_PROPERTIES, sizeof(__pyx_k_SET_START_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SET_START_PROPERTIES */
  {__pyx_k_STATE_SORT_PROPERTIES, sizeof(__pyx_k_STATE_SORT_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_STATE_SORT_PROPERTIES */
  {__pyx_k_STRING, sizeof(__pyx_k_STRING), 0, 1, 1}, /* PyObject cname: __pyx_n_u_STRING */
  {__pyx_k_SortType, sizeof(__pyx_k_SortType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SortType */
  {__pyx_k_StateIterator, sizeof(__pyx_k_StateIterator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StateIterator */
  {__pyx_k_StateIterator___reduce_cython, sizeof(__pyx_k_StateIterator___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StateIterator___reduce_cython */
  {__pyx_k_StateIterator___setstate_cython, sizeof(__pyx_k_StateIterator___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StateIterator___setstate_cython */
  {__pyx_k_StateIterator_at_0x, sizeof(__pyx_k_StateIterator_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_StateIterator_at_0x */
  {__pyx_k_StateIterator_done, sizeof(__pyx_k_StateIterator_done), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StateIterator_done */
  {__pyx_k_StateIterator_next, sizeof(__pyx_k_StateIterator_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StateIterator_next */
  {__pyx_k_StateIterator_reset, sizeof(__pyx_k_StateIterator_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StateIterator_reset */
  {__pyx_k_StateIterator_value, sizeof(__pyx_k_StateIterator_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StateIterator_value */
  {__pyx_k_StateMapType, sizeof(__pyx_k_StateMapType), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StateMapType */
  {__pyx_k_State_index_out_of_range, sizeof(__pyx_k_State_index_out_of_range), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_State_index_out_of_range */
  {__pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 1, 1}, /* PyObject cname: __pyx_n_u_StopIteration */
  {__pyx_k_SymbolTable, sizeof(__pyx_k_SymbolTable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymbolTable */
  {__pyx_k_SymbolTableIterator, sizeof(__pyx_k_SymbolTableIterator), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableIterator */
  {__pyx_k_SymbolTableIterator___reduce_cy, sizeof(__pyx_k_SymbolTableIterator___reduce_cy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableIterator___reduce_cy */
  {__pyx_k_SymbolTableIterator___setstate, sizeof(__pyx_k_SymbolTableIterator___setstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableIterator___setstate */
  {__pyx_k_SymbolTableIterator_at_0x, sizeof(__pyx_k_SymbolTableIterator_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymbolTableIterator_at_0x */
  {__pyx_k_SymbolTableView, sizeof(__pyx_k_SymbolTableView), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView */
  {__pyx_k_SymbolTableView___reduce, sizeof(__pyx_k_SymbolTableView___reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView___reduce */
  {__pyx_k_SymbolTableView_available_key, sizeof(__pyx_k_SymbolTableView_available_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_available_key */
  {__pyx_k_SymbolTableView_checksum, sizeof(__pyx_k_SymbolTableView_checksum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_checksum */
  {__pyx_k_SymbolTableView_copy, sizeof(__pyx_k_SymbolTableView_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_copy */
  {__pyx_k_SymbolTableView_find, sizeof(__pyx_k_SymbolTableView_find), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_find */
  {__pyx_k_SymbolTableView_get_nth_key, sizeof(__pyx_k_SymbolTableView_get_nth_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_get_nth_key */
  {__pyx_k_SymbolTableView_labeled_checksum, sizeof(__pyx_k_SymbolTableView_labeled_checksum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_labeled_checksum */
  {__pyx_k_SymbolTableView_member, sizeof(__pyx_k_SymbolTableView_member), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_member */
  {__pyx_k_SymbolTableView_name, sizeof(__pyx_k_SymbolTableView_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_name */
  {__pyx_k_SymbolTableView_num_symbols, sizeof(__pyx_k_SymbolTableView_num_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_num_symbols */
  {__pyx_k_SymbolTableView_write, sizeof(__pyx_k_SymbolTableView_write), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_write */
  {__pyx_k_SymbolTableView_write_text, sizeof(__pyx_k_SymbolTableView_write_text), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_write_text */
  {__pyx_k_SymbolTableView_write_to_string, sizeof(__pyx_k_SymbolTableView_write_to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTableView_write_to_string */
  {__pyx_k_SymbolTable_2, sizeof(__pyx_k_SymbolTable_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTable_2 */
  {__pyx_k_SymbolTable_no_longer_exists, sizeof(__pyx_k_SymbolTable_no_longer_exists), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_SymbolTable_no_longer_exists */
  {__pyx_k_SymbolTable_read, sizeof(__pyx_k_SymbolTable_read), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTable_read */
  {__pyx_k_SymbolTable_read_fst, sizeof(__pyx_k_SymbolTable_read_fst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTable_read_fst */
  {__pyx_k_SymbolTable_read_text, sizeof(__pyx_k_SymbolTable_read_text), 0, 1, 1}, /* PyObject cname: __pyx_n_u_SymbolTable_read_text */
  {__pyx_k_TOP_SORTED, sizeof(__pyx_k_TOP_SORTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TOP_SORTED */
  {__pyx_k_TRINARY_PROPERTIES, sizeof(__pyx_k_TRINARY_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TRINARY_PROPERTIES */
  {__pyx_k_Tsvg_cairo, sizeof(__pyx_k_Tsvg_cairo), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Tsvg_cairo */
  {__pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_TypeError */
  {__pyx_k_UNWEIGHTED, sizeof(__pyx_k_UNWEIGHTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UNWEIGHTED */
  {__pyx_k_UNWEIGHTED_CYCLES, sizeof(__pyx_k_UNWEIGHTED_CYCLES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_UNWEIGHTED_CYCLES */
  {__pyx_k_Unknown_FAR_type, sizeof(__pyx_k_Unknown_FAR_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_FAR_type */
  {__pyx_k_Unknown_arc_type, sizeof(__pyx_k_Unknown_arc_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_arc_type */
  {__pyx_k_Unknown_compose_filter_type, sizeof(__pyx_k_Unknown_compose_filter_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_compose_filter_type */
  {__pyx_k_Unknown_determinization_type, sizeof(__pyx_k_Unknown_determinization_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_determinization_type */
  {__pyx_k_Unknown_epsilon_normalization_ty, sizeof(__pyx_k_Unknown_epsilon_normalization_ty), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_epsilon_normalization_ty */
  {__pyx_k_Unknown_map_type, sizeof(__pyx_k_Unknown_map_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_map_type */
  {__pyx_k_Unknown_projection_type, sizeof(__pyx_k_Unknown_projection_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_projection_type */
  {__pyx_k_Unknown_queue_type, sizeof(__pyx_k_Unknown_queue_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_queue_type */
  {__pyx_k_Unknown_random_arc_selection_typ, sizeof(__pyx_k_Unknown_random_arc_selection_typ), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_random_arc_selection_typ */
  {__pyx_k_Unknown_replace_label_type, sizeof(__pyx_k_Unknown_replace_label_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_replace_label_type */
  {__pyx_k_Unknown_reweight_type, sizeof(__pyx_k_Unknown_reweight_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_reweight_type */
  {__pyx_k_Unknown_sort_type, sizeof(__pyx_k_Unknown_sort_type), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Unknown_sort_type */
  {__pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ValueError */
  {__pyx_k_VectorFst, sizeof(__pyx_k_VectorFst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_VectorFst */
  {__pyx_k_WEIGHTED, sizeof(__pyx_k_WEIGHTED), 0, 1, 1}, /* PyObject cname: __pyx_n_u_WEIGHTED */
  {__pyx_k_WEIGHTED_CYCLES, sizeof(__pyx_k_WEIGHTED_CYCLES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_WEIGHTED_CYCLES */
  {__pyx_k_WEIGHT_INVARIANT_PROPERTIES, sizeof(__pyx_k_WEIGHT_INVARIANT_PROPERTIES), 0, 1, 1}, /* PyObject cname: __pyx_n_u_WEIGHT_INVARIANT_PROPERTIES */
  {__pyx_k_Weight, sizeof(__pyx_k_Weight), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Weight */
  {__pyx_k_WeightLike, sizeof(__pyx_k_WeightLike), 0, 1, 1}, /* PyObject cname: __pyx_n_u_WeightLike */
  {__pyx_k_WeightProperties, sizeof(__pyx_k_WeightProperties), 0, 1, 1}, /* PyObject cname: __pyx_n_u_WeightProperties */
  {__pyx_k_Weight_2, sizeof(__pyx_k_Weight_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_2 */
  {__pyx_k_Weight___reduce_cython, sizeof(__pyx_k_Weight___reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight___reduce_cython */
  {__pyx_k_Weight___setstate_cython, sizeof(__pyx_k_Weight___setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight___setstate_cython */
  {__pyx_k_Weight_copy, sizeof(__pyx_k_Weight_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_copy */
  {__pyx_k_Weight_member, sizeof(__pyx_k_Weight_member), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_member */
  {__pyx_k_Weight_no_weight, sizeof(__pyx_k_Weight_no_weight), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_no_weight */
  {__pyx_k_Weight_one, sizeof(__pyx_k_Weight_one), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_one */
  {__pyx_k_Weight_properties, sizeof(__pyx_k_Weight_properties), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_properties */
  {__pyx_k_Weight_to_string, sizeof(__pyx_k_Weight_to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_to_string */
  {__pyx_k_Weight_type, sizeof(__pyx_k_Weight_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_type */
  {__pyx_k_Weight_type_not_found, sizeof(__pyx_k_Weight_type_not_found), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Weight_type_not_found */
  {__pyx_k_Weight_zero, sizeof(__pyx_k_Weight_zero), 0, 1, 1}, /* PyObject cname: __pyx_n_u_Weight_zero */
  {__pyx_k_Write_failed, sizeof(__pyx_k_Write_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Write_failed */
  {__pyx_k_Write_to_string_failed, sizeof(__pyx_k_Write_to_string_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_Write_to_string_failed */
  {__pyx_k__2, sizeof(__pyx_k__2), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__2 */
  {__pyx_k__3, sizeof(__pyx_k__3), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__3 */
  {__pyx_k__4, sizeof(__pyx_k__4), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__4 */
  {__pyx_k__40, sizeof(__pyx_k__40), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__40 */
  {__pyx_k__41, sizeof(__pyx_k__41), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__41 */
  {__pyx_k__6, sizeof(__pyx_k__6), 0, 1, 0}, /* PyObject cname: __pyx_kp_u__6 */
  {__pyx_k_a, sizeof(__pyx_k_a), 0, 1, 1}, /* PyObject cname: __pyx_n_u_a */
  {__pyx_k_acceptor, sizeof(__pyx_k_acceptor), 0, 1, 1}, /* PyObject cname: __pyx_n_u_acceptor */
  {__pyx_k_add, sizeof(__pyx_k_add), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add */
  {__pyx_k_add_arc, sizeof(__pyx_k_add_arc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_arc */
  {__pyx_k_add_note, sizeof(__pyx_k_add_note), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_add_note */
  {__pyx_k_add_state, sizeof(__pyx_k_add_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_state */
  {__pyx_k_add_states, sizeof(__pyx_k_add_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_states */
  {__pyx_k_add_symbol, sizeof(__pyx_k_add_symbol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_symbol */
  {__pyx_k_add_table, sizeof(__pyx_k_add_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_add_table */
  {__pyx_k_allow_nondet, sizeof(__pyx_k_allow_nondet), 0, 1, 1}, /* PyObject cname: __pyx_n_u_allow_nondet */
  {__pyx_k_arc, sizeof(__pyx_k_arc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arc */
  {__pyx_k_arc_type, sizeof(__pyx_k_arc_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arc_type */
  {__pyx_k_arc_type_2, sizeof(__pyx_k_arc_type_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arc_type_2 */
  {__pyx_k_arcmap, sizeof(__pyx_k_arcmap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcmap */
  {__pyx_k_arcs, sizeof(__pyx_k_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcs */
  {__pyx_k_arcsort, sizeof(__pyx_k_arcsort), 0, 1, 1}, /* PyObject cname: __pyx_n_u_arcsort */
  {__pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 1, 1}, /* PyObject cname: __pyx_n_u_asyncio_coroutines */
  {__pyx_k_at_0x, sizeof(__pyx_k_at_0x), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_at_0x */
  {__pyx_k_attach_new_isymbols, sizeof(__pyx_k_attach_new_isymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_attach_new_isymbols */
  {__pyx_k_attach_new_osymbols, sizeof(__pyx_k_attach_new_osymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_attach_new_osymbols */
  {__pyx_k_auto, sizeof(__pyx_k_auto), 0, 1, 1}, /* PyObject cname: __pyx_n_u_auto */
  {__pyx_k_available_key, sizeof(__pyx_k_available_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_available_key */
  {__pyx_k_blade_graphviz_server, sizeof(__pyx_k_blade_graphviz_server), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_blade_graphviz_server */
  {__pyx_k_but_received, sizeof(__pyx_k_but_received), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_but_received */
  {__pyx_k_call_arc_labeling, sizeof(__pyx_k_call_arc_labeling), 0, 1, 1}, /* PyObject cname: __pyx_n_u_call_arc_labeling */
  {__pyx_k_checksum, sizeof(__pyx_k_checksum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_checksum */
  {__pyx_k_class, sizeof(__pyx_k_class), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class */
  {__pyx_k_class_2, sizeof(__pyx_k_class_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_class_2 */
  {__pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cline_in_traceback */
  {__pyx_k_closure, sizeof(__pyx_k_closure), 0, 1, 1}, /* PyObject cname: __pyx_n_u_closure */
  {__pyx_k_closure_type, sizeof(__pyx_k_closure_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_closure_type */
  {__pyx_k_cls, sizeof(__pyx_k_cls), 0, 1, 1}, /* PyObject cname: __pyx_n_u_cls */
  {__pyx_k_colabtools, sizeof(__pyx_k_colabtools), 0, 1, 1}, /* PyObject cname: __pyx_n_u_colabtools */
  {__pyx_k_communicate, sizeof(__pyx_k_communicate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_communicate */
  {__pyx_k_compact_symbol_table, sizeof(__pyx_k_compact_symbol_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compact_symbol_table */
  {__pyx_k_compile, sizeof(__pyx_k_compile), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compile */
  {__pyx_k_compose, sizeof(__pyx_k_compose), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compose */
  {__pyx_k_compose_filter, sizeof(__pyx_k_compose_filter), 0, 1, 1}, /* PyObject cname: __pyx_n_u_compose_filter */
  {__pyx_k_concat, sizeof(__pyx_k_concat), 0, 1, 1}, /* PyObject cname: __pyx_n_u_concat */
  {__pyx_k_connect, sizeof(__pyx_k_connect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_connect */
  {__pyx_k_const_EncodeMapper_SymbolTableV, sizeof(__pyx_k_const_EncodeMapper_SymbolTableV), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_const_EncodeMapper_SymbolTableV */
  {__pyx_k_const_Fst_SymbolTableView, sizeof(__pyx_k_const_Fst_SymbolTableView), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_const_Fst_SymbolTableView */
  {__pyx_k_convert, sizeof(__pyx_k_convert), 0, 1, 1}, /* PyObject cname: __pyx_n_u_convert */
  {__pyx_k_copy, sizeof(__pyx_k_copy), 0, 1, 1}, /* PyObject cname: __pyx_n_u_copy */
  {__pyx_k_create, sizeof(__pyx_k_create), 0, 1, 1}, /* PyObject cname: __pyx_n_u_create */
  {__pyx_k_decode, sizeof(__pyx_k_decode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_decode */
  {__pyx_k_default, sizeof(__pyx_k_default), 0, 1, 1}, /* PyObject cname: __pyx_n_u_default */
  {__pyx_k_delete_arcs, sizeof(__pyx_k_delete_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_delete_arcs */
  {__pyx_k_delete_states, sizeof(__pyx_k_delete_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_delete_states */
  {__pyx_k_delta, sizeof(__pyx_k_delta), 0, 1, 1}, /* PyObject cname: __pyx_n_u_delta */
  {__pyx_k_det_type, sizeof(__pyx_k_det_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_det_type */
  {__pyx_k_determinize, sizeof(__pyx_k_determinize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_determinize */
  {__pyx_k_dict, sizeof(__pyx_k_dict), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dict */
  {__pyx_k_difference, sizeof(__pyx_k_difference), 0, 1, 1}, /* PyObject cname: __pyx_n_u_difference */
  {__pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_disable */
  {__pyx_k_disambiguate, sizeof(__pyx_k_disambiguate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_disambiguate */
  {__pyx_k_distance, sizeof(__pyx_k_distance), 0, 1, 1}, /* PyObject cname: __pyx_n_u_distance */
  {__pyx_k_divide, sizeof(__pyx_k_divide), 0, 1, 1}, /* PyObject cname: __pyx_n_u_divide */
  {__pyx_k_doc, sizeof(__pyx_k_doc), 0, 1, 1}, /* PyObject cname: __pyx_n_u_doc */
  {__pyx_k_done, sizeof(__pyx_k_done), 0, 1, 1}, /* PyObject cname: __pyx_n_u_done */
  {__pyx_k_dot, sizeof(__pyx_k_dot), 0, 1, 1}, /* PyObject cname: __pyx_n_u_dot */
  {__pyx_k_draw, sizeof(__pyx_k_draw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_draw */
  {__pyx_k_e, sizeof(__pyx_k_e), 0, 1, 1}, /* PyObject cname: __pyx_n_u_e */
  {__pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_enable */
  {__pyx_k_encode, sizeof(__pyx_k_encode), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encode */
  {__pyx_k_encode_labels, sizeof(__pyx_k_encode_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encode_labels */
  {__pyx_k_encode_weights, sizeof(__pyx_k_encode_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_encode_weights */
  {__pyx_k_enum, sizeof(__pyx_k_enum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_enum */
  {__pyx_k_eps_norm_type, sizeof(__pyx_k_eps_norm_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_eps_norm_type */
  {__pyx_k_epsilon_on_replace, sizeof(__pyx_k_epsilon_on_replace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_epsilon_on_replace */
  {__pyx_k_epsnormalize, sizeof(__pyx_k_epsnormalize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_epsnormalize */
  {__pyx_k_equal, sizeof(__pyx_k_equal), 0, 1, 1}, /* PyObject cname: __pyx_n_u_equal */
  {__pyx_k_equivalent, sizeof(__pyx_k_equivalent), 0, 1, 1}, /* PyObject cname: __pyx_n_u_equivalent */
  {__pyx_k_error, sizeof(__pyx_k_error), 0, 1, 1}, /* PyObject cname: __pyx_n_u_error */
  {__pyx_k_expression, sizeof(__pyx_k_expression), 0, 1, 1}, /* PyObject cname: __pyx_n_u_expression */
  {__pyx_k_failed, sizeof(__pyx_k_failed), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_failed */
  {__pyx_k_far_type, sizeof(__pyx_k_far_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_far_type */
  {__pyx_k_far_type_2, sizeof(__pyx_k_far_type_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_far_type_2 */
  {__pyx_k_final, sizeof(__pyx_k_final), 0, 1, 1}, /* PyObject cname: __pyx_n_u_final */
  {__pyx_k_find, sizeof(__pyx_k_find), 0, 1, 1}, /* PyObject cname: __pyx_n_u_find */
  {__pyx_k_flags, sizeof(__pyx_k_flags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_flags */
  {__pyx_k_flags_2, sizeof(__pyx_k_flags_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_flags_2 */
  {__pyx_k_float_format, sizeof(__pyx_k_float_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_float_format */
  {__pyx_k_fontsize, sizeof(__pyx_k_fontsize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fontsize */
  {__pyx_k_format, sizeof(__pyx_k_format), 0, 1, 1}, /* PyObject cname: __pyx_n_u_format */
  {__pyx_k_frontend, sizeof(__pyx_k_frontend), 0, 1, 1}, /* PyObject cname: __pyx_n_u_frontend */
  {__pyx_k_fspath, sizeof(__pyx_k_fspath), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fspath */
  {__pyx_k_fst2, sizeof(__pyx_k_fst2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fst2 */
  {__pyx_k_fst2_2, sizeof(__pyx_k_fst2_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fst2_2 */
  {__pyx_k_fst_type, sizeof(__pyx_k_fst_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fst_type */
  {__pyx_k_fsts2, sizeof(__pyx_k_fsts2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fsts2 */
  {__pyx_k_fsts2_2, sizeof(__pyx_k_fsts2_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_fsts2_2 */
  {__pyx_k_func, sizeof(__pyx_k_func), 0, 1, 1}, /* PyObject cname: __pyx_n_u_func */
  {__pyx_k_functional, sizeof(__pyx_k_functional), 0, 1, 1}, /* PyObject cname: __pyx_n_u_functional */
  {__pyx_k_g, sizeof(__pyx_k_g), 0, 1, 1}, /* PyObject cname: __pyx_n_u_g */
  {__pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_gc */
  {__pyx_k_get_fst, sizeof(__pyx_k_get_fst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_fst */
  {__pyx_k_get_key, sizeof(__pyx_k_get_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_key */
  {__pyx_k_get_nth_key, sizeof(__pyx_k_get_nth_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_get_nth_key */
  {__pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_getstate */
  {__pyx_k_google3_visualization_graphviz_s, sizeof(__pyx_k_google3_visualization_graphviz_s), 0, 1, 1}, /* PyObject cname: __pyx_n_u_google3_visualization_graphviz_s */
  {__pyx_k_graph, sizeof(__pyx_k_graph), 0, 1, 1}, /* PyObject cname: __pyx_n_u_graph */
  {__pyx_k_graphviz_server_pb2, sizeof(__pyx_k_graphviz_server_pb2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_graphviz_server_pb2 */
  {__pyx_k_height, sizeof(__pyx_k_height), 0, 1, 1}, /* PyObject cname: __pyx_n_u_height */
  {__pyx_k_id, sizeof(__pyx_k_id), 0, 1, 1}, /* PyObject cname: __pyx_n_u_id */
  {__pyx_k_identity, sizeof(__pyx_k_identity), 0, 1, 1}, /* PyObject cname: __pyx_n_u_identity */
  {__pyx_k_ifst, sizeof(__pyx_k_ifst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ifst */
  {__pyx_k_ifst1, sizeof(__pyx_k_ifst1), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ifst1 */
  {__pyx_k_ifst2, sizeof(__pyx_k_ifst2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ifst2 */
  {__pyx_k_ilabel, sizeof(__pyx_k_ilabel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ilabel */
  {__pyx_k_increment_subsequential_label, sizeof(__pyx_k_increment_subsequential_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_increment_subsequential_label */
  {__pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_initializing */
  {__pyx_k_input, sizeof(__pyx_k_input), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input */
  {__pyx_k_input_symbols, sizeof(__pyx_k_input_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_symbols */
  {__pyx_k_input_table, sizeof(__pyx_k_input_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_input_table */
  {__pyx_k_intersect, sizeof(__pyx_k_intersect), 0, 1, 1}, /* PyObject cname: __pyx_n_u_intersect */
  {__pyx_k_invert, sizeof(__pyx_k_invert), 0, 1, 1}, /* PyObject cname: __pyx_n_u_invert */
  {__pyx_k_ipairs, sizeof(__pyx_k_ipairs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ipairs */
  {__pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 1, 1}, /* PyObject cname: __pyx_n_u_is_coroutine */
  {__pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_isenabled */
  {__pyx_k_isomorphic, sizeof(__pyx_k_isomorphic), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isomorphic */
  {__pyx_k_isymbols, sizeof(__pyx_k_isymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_isymbols */
  {__pyx_k_items, sizeof(__pyx_k_items), 0, 1, 1}, /* PyObject cname: __pyx_n_u_items */
  {__pyx_k_keep_isymbols, sizeof(__pyx_k_keep_isymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keep_isymbols */
  {__pyx_k_keep_osymbols, sizeof(__pyx_k_keep_osymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keep_osymbols */
  {__pyx_k_keep_state_numbering, sizeof(__pyx_k_keep_state_numbering), 0, 1, 1}, /* PyObject cname: __pyx_n_u_keep_state_numbering */
  {__pyx_k_key, sizeof(__pyx_k_key), 0, 1, 1}, /* PyObject cname: __pyx_n_u_key */
  {__pyx_k_labeled_checksum, sizeof(__pyx_k_labeled_checksum), 0, 1, 1}, /* PyObject cname: __pyx_n_u_labeled_checksum */
  {__pyx_k_lhs, sizeof(__pyx_k_lhs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_lhs */
  {__pyx_k_logging, sizeof(__pyx_k_logging), 0, 1, 1}, /* PyObject cname: __pyx_n_u_logging */
  {__pyx_k_main, sizeof(__pyx_k_main), 0, 1, 1}, /* PyObject cname: __pyx_n_u_main */
  {__pyx_k_map_type, sizeof(__pyx_k_map_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_map_type */
  {__pyx_k_mapper, sizeof(__pyx_k_mapper), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mapper */
  {__pyx_k_mapper_2, sizeof(__pyx_k_mapper_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mapper_2 */
  {__pyx_k_mask, sizeof(__pyx_k_mask), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mask */
  {__pyx_k_mask_2, sizeof(__pyx_k_mask_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mask_2 */
  {__pyx_k_max_length, sizeof(__pyx_k_max_length), 0, 1, 1}, /* PyObject cname: __pyx_n_u_max_length */
  {__pyx_k_member, sizeof(__pyx_k_member), 0, 1, 1}, /* PyObject cname: __pyx_n_u_member */
  {__pyx_k_members, sizeof(__pyx_k_members), 0, 1, 1}, /* PyObject cname: __pyx_n_u_members */
  {__pyx_k_merge_symbol_table, sizeof(__pyx_k_merge_symbol_table), 0, 1, 1}, /* PyObject cname: __pyx_n_u_merge_symbol_table */
  {__pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 1, 1}, /* PyObject cname: __pyx_n_u_metaclass */
  {__pyx_k_minimize, sizeof(__pyx_k_minimize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_minimize */
  {__pyx_k_missing_sym, sizeof(__pyx_k_missing_sym), 0, 1, 1}, /* PyObject cname: __pyx_n_u_missing_sym */
  {__pyx_k_module, sizeof(__pyx_k_module), 0, 1, 1}, /* PyObject cname: __pyx_n_u_module */
  {__pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mro_entries */
  {__pyx_k_mutable_arcs, sizeof(__pyx_k_mutable_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mutable_arcs */
  {__pyx_k_mutable_input_symbols, sizeof(__pyx_k_mutable_input_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mutable_input_symbols */
  {__pyx_k_mutable_output_symbols, sizeof(__pyx_k_mutable_output_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_mutable_output_symbols */
  {__pyx_k_n, sizeof(__pyx_k_n), 0, 1, 1}, /* PyObject cname: __pyx_n_u_n */
  {__pyx_k_name, sizeof(__pyx_k_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name */
  {__pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_name_2 */
  {__pyx_k_neither, sizeof(__pyx_k_neither), 0, 1, 1}, /* PyObject cname: __pyx_n_u_neither */
  {__pyx_k_new_isymbols, sizeof(__pyx_k_new_isymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_isymbols */
  {__pyx_k_new_name, sizeof(__pyx_k_new_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_name */
  {__pyx_k_new_osymbols, sizeof(__pyx_k_new_osymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_new_osymbols */
  {__pyx_k_next, sizeof(__pyx_k_next), 0, 1, 1}, /* PyObject cname: __pyx_n_u_next */
  {__pyx_k_nextstate, sizeof(__pyx_k_nextstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nextstate */
  {__pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_no_default___reduce___due_to_non */
  {__pyx_k_no_weight, sizeof(__pyx_k_no_weight), 0, 1, 1}, /* PyObject cname: __pyx_n_u_no_weight */
  {__pyx_k_nodesep, sizeof(__pyx_k_nodesep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nodesep */
  {__pyx_k_npath, sizeof(__pyx_k_npath), 0, 1, 1}, /* PyObject cname: __pyx_n_u_npath */
  {__pyx_k_nshortest, sizeof(__pyx_k_nshortest), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nshortest */
  {__pyx_k_nstate, sizeof(__pyx_k_nstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_nstate */
  {__pyx_k_num_arcs, sizeof(__pyx_k_num_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_arcs */
  {__pyx_k_num_input_epsilons, sizeof(__pyx_k_num_input_epsilons), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_input_epsilons */
  {__pyx_k_num_output_epsilons, sizeof(__pyx_k_num_output_epsilons), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_output_epsilons */
  {__pyx_k_num_states, sizeof(__pyx_k_num_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_states */
  {__pyx_k_num_states_if_known, sizeof(__pyx_k_num_states_if_known), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_states_if_known */
  {__pyx_k_num_symbols, sizeof(__pyx_k_num_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_num_symbols */
  {__pyx_k_numbers, sizeof(__pyx_k_numbers), 0, 1, 1}, /* PyObject cname: __pyx_n_u_numbers */
  {__pyx_k_olabel, sizeof(__pyx_k_olabel), 0, 1, 1}, /* PyObject cname: __pyx_n_u_olabel */
  {__pyx_k_old_isymbols, sizeof(__pyx_k_old_isymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_old_isymbols */
  {__pyx_k_old_osymbols, sizeof(__pyx_k_old_osymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_old_osymbols */
  {__pyx_k_one, sizeof(__pyx_k_one), 0, 1, 1}, /* PyObject cname: __pyx_n_u_one */
  {__pyx_k_opairs, sizeof(__pyx_k_opairs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_opairs */
  {__pyx_k_open, sizeof(__pyx_k_open), 0, 1, 1}, /* PyObject cname: __pyx_n_u_open */
  {__pyx_k_os, sizeof(__pyx_k_os), 0, 1, 1}, /* PyObject cname: __pyx_n_u_os */
  {__pyx_k_osymbols, sizeof(__pyx_k_osymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_osymbols */
  {__pyx_k_output_symbols, sizeof(__pyx_k_output_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_output_symbols */
  {__pyx_k_pairs, sizeof(__pyx_k_pairs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pairs */
  {__pyx_k_plus, sizeof(__pyx_k_plus), 0, 1, 1}, /* PyObject cname: __pyx_n_u_plus */
  {__pyx_k_pop, sizeof(__pyx_k_pop), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pop */
  {__pyx_k_portrait, sizeof(__pyx_k_portrait), 0, 1, 1}, /* PyObject cname: __pyx_n_u_portrait */
  {__pyx_k_pos, sizeof(__pyx_k_pos), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pos */
  {__pyx_k_position, sizeof(__pyx_k_position), 0, 1, 1}, /* PyObject cname: __pyx_n_u_position */
  {__pyx_k_potentials, sizeof(__pyx_k_potentials), 0, 1, 1}, /* PyObject cname: __pyx_n_u_potentials */
  {__pyx_k_power, sizeof(__pyx_k_power), 0, 1, 1}, /* PyObject cname: __pyx_n_u_power */
  {__pyx_k_precision, sizeof(__pyx_k_precision), 0, 1, 1}, /* PyObject cname: __pyx_n_u_precision */
  {__pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prepare */
  {__pyx_k_print, sizeof(__pyx_k_print), 0, 1, 1}, /* PyObject cname: __pyx_n_u_print */
  {__pyx_k_project, sizeof(__pyx_k_project), 0, 1, 1}, /* PyObject cname: __pyx_n_u_project */
  {__pyx_k_project_type, sizeof(__pyx_k_project_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_project_type */
  {__pyx_k_properties, sizeof(__pyx_k_properties), 0, 1, 1}, /* PyObject cname: __pyx_n_u_properties */
  {__pyx_k_props, sizeof(__pyx_k_props), 0, 1, 1}, /* PyObject cname: __pyx_n_u_props */
  {__pyx_k_props_2, sizeof(__pyx_k_props_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_props_2 */
  {__pyx_k_prune, sizeof(__pyx_k_prune), 0, 1, 1}, /* PyObject cname: __pyx_n_u_prune */
  {__pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ptr */
  {__pyx_k_push, sizeof(__pyx_k_push), 0, 1, 1}, /* PyObject cname: __pyx_n_u_push */
  {__pyx_k_push_labels, sizeof(__pyx_k_push_labels), 0, 1, 1}, /* PyObject cname: __pyx_n_u_push_labels */
  {__pyx_k_push_weights, sizeof(__pyx_k_push_weights), 0, 1, 1}, /* PyObject cname: __pyx_n_u_push_weights */
  {__pyx_k_pywrapfst_2, sizeof(__pyx_k_pywrapfst_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pywrapfst_2 */
  {__pyx_k_pywrapfst_pyx, sizeof(__pyx_k_pywrapfst_pyx), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_pywrapfst_pyx */
  {__pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_state */
  {__pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 1, 1}, /* PyObject cname: __pyx_n_u_pyx_vtable */
  {__pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 1, 1}, /* PyObject cname: __pyx_n_u_qualname */
  {__pyx_k_queue_type, sizeof(__pyx_k_queue_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_queue_type */
  {__pyx_k_randequivalent, sizeof(__pyx_k_randequivalent), 0, 1, 1}, /* PyObject cname: __pyx_n_u_randequivalent */
  {__pyx_k_randgen, sizeof(__pyx_k_randgen), 0, 1, 1}, /* PyObject cname: __pyx_n_u_randgen */
  {__pyx_k_ranksep, sizeof(__pyx_k_ranksep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ranksep */
  {__pyx_k_raw, sizeof(__pyx_k_raw), 0, 1, 1}, /* PyObject cname: __pyx_n_u_raw */
  {__pyx_k_read, sizeof(__pyx_k_read), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read */
  {__pyx_k_read_EncodeMapper_from_string, sizeof(__pyx_k_read_EncodeMapper_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_EncodeMapper_from_string */
  {__pyx_k_read_Fst, sizeof(__pyx_k_read_Fst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_Fst */
  {__pyx_k_read_Fst_from_string, sizeof(__pyx_k_read_Fst_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_Fst_from_string */
  {__pyx_k_read_SymbolTable_from_string, sizeof(__pyx_k_read_SymbolTable_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_SymbolTable_from_string */
  {__pyx_k_read_from_string, sizeof(__pyx_k_read_from_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_from_string */
  {__pyx_k_read_fst, sizeof(__pyx_k_read_fst), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_fst */
  {__pyx_k_read_text, sizeof(__pyx_k_read_text), 0, 1, 1}, /* PyObject cname: __pyx_n_u_read_text */
  {__pyx_k_reader, sizeof(__pyx_k_reader), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reader */
  {__pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce */
  {__pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_cython */
  {__pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reduce_ex */
  {__pyx_k_relabel_pairs, sizeof(__pyx_k_relabel_pairs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_relabel_pairs */
  {__pyx_k_relabel_tables, sizeof(__pyx_k_relabel_tables), 0, 1, 1}, /* PyObject cname: __pyx_n_u_relabel_tables */
  {__pyx_k_remove_common_affix, sizeof(__pyx_k_remove_common_affix), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove_common_affix */
  {__pyx_k_remove_total_weight, sizeof(__pyx_k_remove_total_weight), 0, 1, 1}, /* PyObject cname: __pyx_n_u_remove_total_weight */
  {__pyx_k_rendered_bytes, sizeof(__pyx_k_rendered_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rendered_bytes */
  {__pyx_k_rendered_graph, sizeof(__pyx_k_rendered_graph), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rendered_graph */
  {__pyx_k_replace, sizeof(__pyx_k_replace), 0, 1, 1}, /* PyObject cname: __pyx_n_u_replace */
  {__pyx_k_repr_svg, sizeof(__pyx_k_repr_svg), 0, 1, 1}, /* PyObject cname: __pyx_n_u_repr_svg */
  {__pyx_k_require_superinitial, sizeof(__pyx_k_require_superinitial), 0, 1, 1}, /* PyObject cname: __pyx_n_u_require_superinitial */
  {__pyx_k_reserve_arcs, sizeof(__pyx_k_reserve_arcs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reserve_arcs */
  {__pyx_k_reserve_states, sizeof(__pyx_k_reserve_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reserve_states */
  {__pyx_k_reset, sizeof(__pyx_k_reset), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reset */
  {__pyx_k_result, sizeof(__pyx_k_result), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result */
  {__pyx_k_result_2, sizeof(__pyx_k_result_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_result_2 */
  {__pyx_k_return_arc_labeling, sizeof(__pyx_k_return_arc_labeling), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return_arc_labeling */
  {__pyx_k_return_bytes, sizeof(__pyx_k_return_bytes), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return_bytes */
  {__pyx_k_return_label, sizeof(__pyx_k_return_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_return_label */
  {__pyx_k_reverse, sizeof(__pyx_k_reverse), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reverse */
  {__pyx_k_reweight, sizeof(__pyx_k_reweight), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reweight */
  {__pyx_k_reweight_type, sizeof(__pyx_k_reweight_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_reweight_type */
  {__pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rhs */
  {__pyx_k_rmepsilon, sizeof(__pyx_k_rmepsilon), 0, 1, 1}, /* PyObject cname: __pyx_n_u_rmepsilon */
  {__pyx_k_seed, sizeof(__pyx_k_seed), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seed */
  {__pyx_k_seek, sizeof(__pyx_k_seek), 0, 1, 1}, /* PyObject cname: __pyx_n_u_seek */
  {__pyx_k_select, sizeof(__pyx_k_select), 0, 1, 1}, /* PyObject cname: __pyx_n_u_select */
  {__pyx_k_self, sizeof(__pyx_k_self), 0, 1, 1}, /* PyObject cname: __pyx_n_u_self */
  {__pyx_k_self__arc_cannot_be_converted_to, sizeof(__pyx_k_self__arc_cannot_be_converted_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_self__arc_cannot_be_converted_to */
  {__pyx_k_self__fst_self__it_cannot_be_con, sizeof(__pyx_k_self__fst_self__it_cannot_be_con), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_self__fst_self__it_cannot_be_con */
  {__pyx_k_self__fst_self__it_self__mfst_se, sizeof(__pyx_k_self__fst_self__it_self__mfst_se), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_self__fst_self__it_self__mfst_se */
  {__pyx_k_self__it_cannot_be_converted_to, sizeof(__pyx_k_self__it_cannot_be_converted_to), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_self__it_cannot_be_converted_to */
  {__pyx_k_self__reader_cannot_be_converted, sizeof(__pyx_k_self__reader_cannot_be_converted), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_self__reader_cannot_be_converted */
  {__pyx_k_self__weight_cannot_be_converted, sizeof(__pyx_k_self__weight_cannot_be_converted), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_self__weight_cannot_be_converted */
  {__pyx_k_self__writer_cannot_be_converted, sizeof(__pyx_k_self__writer_cannot_be_converted), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_self__writer_cannot_be_converted */
  {__pyx_k_sep, sizeof(__pyx_k_sep), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sep */
  {__pyx_k_sep_2, sizeof(__pyx_k_sep_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sep_2 */
  {__pyx_k_set_final, sizeof(__pyx_k_set_final), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_final */
  {__pyx_k_set_flags, sizeof(__pyx_k_set_flags), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_flags */
  {__pyx_k_set_input_symbols, sizeof(__pyx_k_set_input_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_input_symbols */
  {__pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name */
  {__pyx_k_set_name_2, sizeof(__pyx_k_set_name_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_name_2 */
  {__pyx_k_set_output_symbols, sizeof(__pyx_k_set_output_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_output_symbols */
  {__pyx_k_set_properties, sizeof(__pyx_k_set_properties), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_properties */
  {__pyx_k_set_start, sizeof(__pyx_k_set_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_start */
  {__pyx_k_set_value, sizeof(__pyx_k_set_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_set_value */
  {__pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setstate */
  {__pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 1, 1}, /* PyObject cname: __pyx_n_u_setstate_cython */
  {__pyx_k_shortestdistance, sizeof(__pyx_k_shortestdistance), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shortestdistance */
  {__pyx_k_shortestpath, sizeof(__pyx_k_shortestpath), 0, 1, 1}, /* PyObject cname: __pyx_n_u_shortestpath */
  {__pyx_k_show_weight_one, sizeof(__pyx_k_show_weight_one), 0, 1, 1}, /* PyObject cname: __pyx_n_u_show_weight_one */
  {__pyx_k_sort_type, sizeof(__pyx_k_sort_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sort_type */
  {__pyx_k_source, sizeof(__pyx_k_source), 0, 1, 1}, /* PyObject cname: __pyx_n_u_source */
  {__pyx_k_source_2, sizeof(__pyx_k_source_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_source_2 */
  {__pyx_k_sources, sizeof(__pyx_k_sources), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sources */
  {__pyx_k_sources_2, sizeof(__pyx_k_sources_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sources_2 */
  {__pyx_k_spec, sizeof(__pyx_k_spec), 0, 1, 1}, /* PyObject cname: __pyx_n_u_spec */
  {__pyx_k_sstrm, sizeof(__pyx_k_sstrm), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sstrm */
  {__pyx_k_ssymbols, sizeof(__pyx_k_ssymbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_ssymbols */
  {__pyx_k_standard, sizeof(__pyx_k_standard), 0, 1, 1}, /* PyObject cname: __pyx_n_u_standard */
  {__pyx_k_star, sizeof(__pyx_k_star), 0, 1, 1}, /* PyObject cname: __pyx_n_u_star */
  {__pyx_k_start, sizeof(__pyx_k_start), 0, 1, 1}, /* PyObject cname: __pyx_n_u_start */
  {__pyx_k_state, sizeof(__pyx_k_state), 0, 1, 1}, /* PyObject cname: __pyx_n_u_state */
  {__pyx_k_statemap, sizeof(__pyx_k_statemap), 0, 1, 1}, /* PyObject cname: __pyx_n_u_statemap */
  {__pyx_k_states, sizeof(__pyx_k_states), 0, 1, 1}, /* PyObject cname: __pyx_n_u_states */
  {__pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 1, 1}, /* PyObject cname: __pyx_n_u_staticmethod */
  {__pyx_k_stdin, sizeof(__pyx_k_stdin), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stdin */
  {__pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stdout */
  {__pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_stringsource */
  {__pyx_k_stubby, sizeof(__pyx_k_stubby), 0, 1, 1}, /* PyObject cname: __pyx_n_u_stubby */
  {__pyx_k_subprocess, sizeof(__pyx_k_subprocess), 0, 1, 1}, /* PyObject cname: __pyx_n_u_subprocess */
  {__pyx_k_subsequential_label, sizeof(__pyx_k_subsequential_label), 0, 1, 1}, /* PyObject cname: __pyx_n_u_subsequential_label */
  {__pyx_k_symbol, sizeof(__pyx_k_symbol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symbol */
  {__pyx_k_symbols, sizeof(__pyx_k_symbols), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symbols */
  {__pyx_k_symbols_2, sizeof(__pyx_k_symbols_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_symbols_2 */
  {__pyx_k_synchronize, sizeof(__pyx_k_synchronize), 0, 1, 1}, /* PyObject cname: __pyx_n_u_synchronize */
  {__pyx_k_sys, sizeof(__pyx_k_sys), 0, 1, 1}, /* PyObject cname: __pyx_n_u_sys */
  {__pyx_k_test, sizeof(__pyx_k_test), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test */
  {__pyx_k_test_2, sizeof(__pyx_k_test_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_test_2 */
  {__pyx_k_tfar, sizeof(__pyx_k_tfar), 0, 1, 1}, /* PyObject cname: __pyx_n_u_tfar */
  {__pyx_k_times, sizeof(__pyx_k_times), 0, 1, 1}, /* PyObject cname: __pyx_n_u_times */
  {__pyx_k_title, sizeof(__pyx_k_title), 0, 1, 1}, /* PyObject cname: __pyx_n_u_title */
  {__pyx_k_to_initial, sizeof(__pyx_k_to_initial), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_initial */
  {__pyx_k_to_string, sizeof(__pyx_k_to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_to_string */
  {__pyx_k_topsort, sizeof(__pyx_k_topsort), 0, 1, 1}, /* PyObject cname: __pyx_n_u_topsort */
  {__pyx_k_type, sizeof(__pyx_k_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_type */
  {__pyx_k_typing, sizeof(__pyx_k_typing), 0, 1, 1}, /* PyObject cname: __pyx_n_u_typing */
  {__pyx_k_typing_Literal_alt_sequence_auto, sizeof(__pyx_k_typing_Literal_alt_sequence_auto), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_alt_sequence_auto */
  {__pyx_k_typing_Literal_arc_sum_arc_uniqu, sizeof(__pyx_k_typing_Literal_arc_sum_arc_uniqu), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_arc_sum_arc_uniqu */
  {__pyx_k_typing_Literal_auto_fifo_lifo_sh, sizeof(__pyx_k_typing_Literal_auto_fifo_lifo_sh), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_auto_fifo_lifo_sh */
  {__pyx_k_typing_Literal_e_f_g, sizeof(__pyx_k_typing_Literal_e_f_g), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_e_f_g */
  {__pyx_k_typing_Literal_fst_stlist_sttabl, sizeof(__pyx_k_typing_Literal_fst_stlist_sttabl), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_fst_stlist_sttabl */
  {__pyx_k_typing_Literal_functional_nonfun, sizeof(__pyx_k_typing_Literal_functional_nonfun), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_functional_nonfun */
  {__pyx_k_typing_Literal_identity_input_ep, sizeof(__pyx_k_typing_Literal_identity_input_ep), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_identity_input_ep */
  {__pyx_k_typing_Literal_ilabel_olabel, sizeof(__pyx_k_typing_Literal_ilabel_olabel), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_ilabel_olabel */
  {__pyx_k_typing_Literal_input_output, sizeof(__pyx_k_typing_Literal_input_output), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_input_output */
  {__pyx_k_typing_Literal_neither_input_out, sizeof(__pyx_k_typing_Literal_neither_input_out), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_neither_input_out */
  {__pyx_k_typing_Literal_to_initial_to_fin, sizeof(__pyx_k_typing_Literal_to_initial_to_fin), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_to_initial_to_fin */
  {__pyx_k_typing_Literal_uniform_log_prob, sizeof(__pyx_k_typing_Literal_uniform_log_prob), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Literal_uniform_log_prob */
  {__pyx_k_typing_Union_Weight_typing_Union, sizeof(__pyx_k_typing_Union_Weight_typing_Union), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_typing_Union_Weight_typing_Union */
  {__pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 1, 1}, /* PyObject cname: __pyx_n_u_uniform */
  {__pyx_k_union, sizeof(__pyx_k_union), 0, 1, 1}, /* PyObject cname: __pyx_n_u_union */
  {__pyx_k_unique, sizeof(__pyx_k_unique), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unique */
  {__pyx_k_unknown_isymbol, sizeof(__pyx_k_unknown_isymbol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unknown_isymbol */
  {__pyx_k_unknown_osymbol, sizeof(__pyx_k_unknown_osymbol), 0, 1, 1}, /* PyObject cname: __pyx_n_u_unknown_osymbol */
  {__pyx_k_unspecified, sizeof(__pyx_k_unspecified), 0, 1, 0}, /* PyObject cname: __pyx_kp_u_unspecified */
  {__pyx_k_value, sizeof(__pyx_k_value), 0, 1, 1}, /* PyObject cname: __pyx_n_u_value */
  {__pyx_k_vector, sizeof(__pyx_k_vector), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vector */
  {__pyx_k_verify, sizeof(__pyx_k_verify), 0, 1, 1}, /* PyObject cname: __pyx_n_u_verify */
  {__pyx_k_vertical, sizeof(__pyx_k_vertical), 0, 1, 1}, /* PyObject cname: __pyx_n_u_vertical */
  {__pyx_k_w, sizeof(__pyx_k_w), 0, 1, 1}, /* PyObject cname: __pyx_n_u_w */
  {__pyx_k_warning, sizeof(__pyx_k_warning), 0, 1, 1}, /* PyObject cname: __pyx_n_u_warning */
  {__pyx_k_weight, sizeof(__pyx_k_weight), 0, 1, 1}, /* PyObject cname: __pyx_n_u_weight */
  {__pyx_k_weight_2, sizeof(__pyx_k_weight_2), 0, 1, 1}, /* PyObject cname: __pyx_n_u_weight_2 */
  {__pyx_k_weight_type, sizeof(__pyx_k_weight_type), 0, 1, 1}, /* PyObject cname: __pyx_n_u_weight_type */
  {__pyx_k_weighted, sizeof(__pyx_k_weighted), 0, 1, 1}, /* PyObject cname: __pyx_n_u_weighted */
  {__pyx_k_width, sizeof(__pyx_k_width), 0, 1, 1}, /* PyObject cname: __pyx_n_u_width */
  {__pyx_k_write, sizeof(__pyx_k_write), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write */
  {__pyx_k_write_text, sizeof(__pyx_k_write_text), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write_text */
  {__pyx_k_write_to_string, sizeof(__pyx_k_write_to_string), 0, 1, 1}, /* PyObject cname: __pyx_n_u_write_to_string */
  {__pyx_k_writer, sizeof(__pyx_k_writer), 0, 1, 1}, /* PyObject cname: __pyx_n_u_writer */
  {__pyx_k_x, sizeof(__pyx_k_x), 0, 1, 1}, /* PyObject cname: __pyx_n_u_x */
  {__pyx_k_zero, sizeof(__pyx_k_zero), 0, 1, 1}, /* PyObject cname: __pyx_n_u_zero */
  {0, 0, 0, 0, 0}
};
/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names);

/* #### Code section: cached_builtins ### */

static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 110, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 161, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 171, __pyx_L1_error)
  __pyx_builtin_IOError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_IOError); if (!__pyx_builtin_IOError) __PYX_ERR(0, 176, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 181, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 1561, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 210, __pyx_L1_error)
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_id); if (!__pyx_builtin_id) __PYX_ERR(0, 534, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 837, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 1413, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_mstate->__pyx_n_u_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 4995, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  __Pyx_RefNannyDeclarations
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "pywrapfst.pyx":1840
 *     return _init_XFst(new fst.FstClass(deref(self._fst)))
 * 
 *   cpdef void draw(self,             # <<<<<<<<<<<<<<
 *                   source,
 *                   SymbolTableView isymbols=None,
*/
  __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(16, Py_None, Py_None, Py_None, Py_False, __pyx_mstate_global->__pyx_kp_u__6, __pyx_mstate_global->__pyx_float_8_5, __pyx_mstate_global->__pyx_float_11_0, Py_False, Py_False, __pyx_mstate_global->__pyx_float_0_4, __pyx_mstate_global->__pyx_float_0_25, __pyx_mstate_global->__pyx_int_14, __pyx_mstate_global->__pyx_int_5, __pyx_mstate_global->__pyx_n_u_g, Py_False, __pyx_mstate_global->__pyx_n_u_dot); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 1840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

  /* "pywrapfst.pyx":2054
 *     return _init_FstSymbolTableView(self._fst, input_side=False)
 * 
 *   cpdef string print(self, SymbolTableView isymbols=None,             # <<<<<<<<<<<<<<
 *       SymbolTableView osymbols=None, SymbolTableView ssymbols=None,
 *       bool acceptor=False, bool show_weight_one=False,
*/
  __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(6, Py_None, Py_None, Py_None, Py_False, Py_False, __pyx_mstate_global->__pyx_kp_u__6); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 2054, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

  /* "pywrapfst.pyx":2328
 *       fst.ArcSort(self._mfst.get(), _sort_type)
 * 
 *   def arcsort(self, sort_type="ilabel"):             # <<<<<<<<<<<<<<
 *     """
 *     arcsort(self, sort_type="ilabel")
*/
  __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_ilabel); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 2328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

  /* "pywrapfst.pyx":2355
 *       fst.Closure(self._mfst.get(), _type)
 * 
 *   def closure(self, closure_type="star"):             # <<<<<<<<<<<<<<
 *     """
 *     closure(self, closure_type="star")
*/
  __pyx_mstate_global->__pyx_tuple[3] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_star); if (unlikely(!__pyx_mstate_global->__pyx_tuple[3])) __PYX_ERR(0, 2355, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[3]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[3]);

  /* "pywrapfst.pyx":2456
 *     self._check_mutating_imethod()
 * 
 *   def delete_arcs(self, int64_t state, size_t n=0):             # <<<<<<<<<<<<<<
 *     """
 *     delete_arcs(self, state, n=0)
*/
  __pyx_mstate_global->__pyx_tuple[4] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[4])) __PYX_ERR(0, 2456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[4]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[4]);

  /* "pywrapfst.pyx":2494
 *     self._check_mutating_imethod()
 * 
 *   def delete_states(self, states=None):             # <<<<<<<<<<<<<<
 *     """
 *     delete_states(self, states=None)
*/
  __pyx_mstate_global->__pyx_tuple[5] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[5])) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[5]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[5]);

  /* "pywrapfst.pyx":2758
 *     self._check_mutating_imethod()
 * 
 *   def relabel_pairs(self, ipairs=None, opairs=None):             # <<<<<<<<<<<<<<
 *     """
 *     relabel_pairs(self, ipairs=None, opairs=None)
*/
  __pyx_mstate_global->__pyx_tuple[6] = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[6])) __PYX_ERR(0, 2758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[6]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[6]);

  /* "pywrapfst.pyx":2818
 *     self._check_mutating_imethod()
 * 
 *   def relabel_tables(self,             # <<<<<<<<<<<<<<
 *                      SymbolTableView old_isymbols=None,
 *                      SymbolTableView new_isymbols=None,
*/
  __pyx_mstate_global->__pyx_tuple[7] = PyTuple_Pack(8, Py_None, Py_None, __pyx_mstate_global->__pyx_kp_u__6, Py_True, Py_None, Py_None, __pyx_mstate_global->__pyx_kp_u__6, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[7])) __PYX_ERR(0, 2818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[7]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[7]);

  /* "pywrapfst.pyx":2926
 *     self._check_mutating_imethod()
 * 
 *   def reweight(self, potentials, reweight_type="to_initial"):             # <<<<<<<<<<<<<<
 *     """
 *     reweight(self, potentials, reweight_type="to_initial")
*/
  __pyx_mstate_global->__pyx_tuple[8] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_to_initial); if (unlikely(!__pyx_mstate_global->__pyx_tuple[8])) __PYX_ERR(0, 2926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[8]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[8]);

  /* "pywrapfst.pyx":3902
 * 
 * 
 * cpdef MutableFst compose(Fst ifst1,             # <<<<<<<<<<<<<<
 *                          Fst ifst2,
 *                          compose_filter="auto",
*/
  __pyx_mstate_global->__pyx_tuple[9] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_auto, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[9])) __PYX_ERR(0, 3902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[9]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[9]);

  /* "pywrapfst.pyx":3942
 * 
 * 
 * cpdef Fst convert(Fst ifst, fst_type=""):             # <<<<<<<<<<<<<<
 *   """
 *   convert(ifst, fst_type="")
*/
  __pyx_mstate_global->__pyx_tuple[10] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_kp_u__6); if (unlikely(!__pyx_mstate_global->__pyx_tuple[10])) __PYX_ERR(0, 3942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[10]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[10]);

  /* "pywrapfst.pyx":4029
 * 
 * 
 * cpdef MutableFst difference(Fst ifst1,             # <<<<<<<<<<<<<<
 *                             Fst ifst2,
 *                             compose_filter="auto",
*/
  __pyx_mstate_global->__pyx_tuple[11] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_auto, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[11])) __PYX_ERR(0, 4029, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[11]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[11]);

  /* "pywrapfst.pyx":4114
 * 
 * 
 * cpdef MutableFst epsnormalize(Fst ifst, eps_norm_type="input"):             # <<<<<<<<<<<<<<
 *   """
 *   epsnormalize(ifst, eps_norm_type="input")
*/
  __pyx_mstate_global->__pyx_tuple[12] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_input); if (unlikely(!__pyx_mstate_global->__pyx_tuple[12])) __PYX_ERR(0, 4114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[12]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[12]);

  /* "pywrapfst.pyx":4196
 * 
 * 
 * cpdef MutableFst intersect(Fst ifst1,             # <<<<<<<<<<<<<<
 *                            Fst ifst2,
 *                            compose_filter="auto",
*/
  __pyx_mstate_global->__pyx_tuple[13] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_auto, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[13])) __PYX_ERR(0, 4196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[13]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[13]);

  /* "pywrapfst.pyx":4453
 * 
 * 
 * cpdef MutableFst replace(pairs,             # <<<<<<<<<<<<<<
 *                          call_arc_labeling="input",
 *                          return_arc_labeling="neither",
*/
  __pyx_mstate_global->__pyx_tuple[14] = PyTuple_Pack(4, __pyx_mstate_global->__pyx_n_u_input, __pyx_mstate_global->__pyx_n_u_neither, Py_False, __pyx_mstate_global->__pyx_int_0); if (unlikely(!__pyx_mstate_global->__pyx_tuple[14])) __PYX_ERR(0, 4453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[14]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[14]);

  /* "pywrapfst.pyx":4514
 * 
 * 
 * cpdef MutableFst reverse(Fst ifst, bool require_superinitial=True):             # <<<<<<<<<<<<<<
 *   """
 *   reverse(ifst, require_superinitial=True)
*/
  __pyx_mstate_global->__pyx_tuple[15] = PyTuple_Pack(1, Py_True); if (unlikely(!__pyx_mstate_global->__pyx_tuple[15])) __PYX_ERR(0, 4514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[15]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[15]);

  /* "pywrapfst.pyx":5036
 *     return f"<{self.far_type()} FarWriter at 0x{id(self):x}>"
 * 
 *   @classmethod             # <<<<<<<<<<<<<<
 *   def create(cls, source, arc_type="standard", far_type="default"):
 *     """
*/
  __pyx_mstate_global->__pyx_tuple[16] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_standard, __pyx_mstate_global->__pyx_n_u_default); if (unlikely(!__pyx_mstate_global->__pyx_tuple[16])) __PYX_ERR(0, 5036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[16]);
  __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[16]);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_constants ### */

static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  CYTHON_UNUSED_VAR(__pyx_mstate);
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  if (__Pyx_InitStrings(__pyx_string_tab, __pyx_mstate->__pyx_string_tab, __pyx_string_tab_encodings) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_mstate->__pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_mstate->__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_0_4 = PyFloat_FromDouble(0.4); if (unlikely(!__pyx_mstate->__pyx_float_0_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_8_5 = PyFloat_FromDouble(8.5); if (unlikely(!__pyx_mstate->__pyx_float_8_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_0_25 = PyFloat_FromDouble(0.25); if (unlikely(!__pyx_mstate->__pyx_float_0_25)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_float_11_0 = PyFloat_FromDouble(11.0); if (unlikely(!__pyx_mstate->__pyx_float_11_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_0 = PyLong_FromLong(0); if (unlikely(!__pyx_mstate->__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_1 = PyLong_FromLong(1); if (unlikely(!__pyx_mstate->__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_5 = PyLong_FromLong(5); if (unlikely(!__pyx_mstate->__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_mstate->__pyx_int_14 = PyLong_FromLong(14); if (unlikely(!__pyx_mstate->__pyx_int_14)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_codeobjects ### */
typedef struct {
    unsigned int argcount : 5;
    unsigned int num_posonly_args : 1;
    unsigned int num_kwonly_args : 1;
    unsigned int nlocals : 5;
    unsigned int flags : 10;
    unsigned int first_line : 13;
    unsigned int line_table_length : 13;
} __Pyx_PyCode_New_function_description;
/* NewCodeObj.proto */
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        const char *line_table,
        PyObject *tuple_dedup_map
);


static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  PyObject* tuple_dedup_map = PyDict_New();
  if (unlikely(!tuple_dedup_map)) return -1;
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 513, 40};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_k_86_QfD_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 523, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_type, __pyx_k_4xt2U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 530, 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_to_string, __pyx_k_4xt2Ya, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 545, 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_member, __pyx_k_4xt2WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 548, 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_props_2};
    __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_properties, __pyx_k_d_b_1_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 570, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_weight_type};
    __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_zero, __pyx_k_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 579, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_weight_type};
    __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_one, __pyx_k_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 588, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_weight_type};
    __pyx_mstate_global->__pyx_codeobj_tab[7] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_no_weight, __pyx_k_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[7])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[8] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[8])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[9] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[9])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 605, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_lhs, __pyx_mstate->__pyx_n_u_rhs, __pyx_mstate->__pyx_n_u_weight_2};
    __pyx_mstate_global->__pyx_codeobj_tab[10] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_plus, __pyx_k_Qe1_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[10])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 637, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_lhs, __pyx_mstate->__pyx_n_u_rhs, __pyx_mstate->__pyx_n_u_weight_2};
    __pyx_mstate_global->__pyx_codeobj_tab[11] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_times, __pyx_k_auA_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[11])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 669, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_lhs, __pyx_mstate->__pyx_n_u_rhs, __pyx_mstate->__pyx_n_u_weight_2};
    __pyx_mstate_global->__pyx_codeobj_tab[12] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_divide, __pyx_k_q_Q_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[12])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 702, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_w, __pyx_mstate->__pyx_n_u_n, __pyx_mstate->__pyx_n_u_weight_2};
    __pyx_mstate_global->__pyx_codeobj_tab[13] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_power, __pyx_k_as_q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[13])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 844, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[14] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_k_D0, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[14])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 866, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[15] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_available_key, __pyx_k_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[15])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 874, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[16] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_checksum, __pyx_k_4_9A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[16])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 882, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[17] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_k_AZq_b_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[17])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 890, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_raw};
    __pyx_mstate_global->__pyx_codeobj_tab[18] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_find, __pyx_k_d_A_T_1HAQ_T_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[18])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 913, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pos};
    __pyx_mstate_global->__pyx_codeobj_tab[19] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_get_nth_key, __pyx_k_4_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[19])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 927, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[20] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_labeled_checksum, __pyx_k_4_31, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[20])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 935, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key};
    __pyx_mstate_global->__pyx_codeobj_tab[21] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_member, __pyx_k_d_A_T_axq_T_Qa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[21])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 957, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[22] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_name_2, __pyx_k_4_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[22])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 965, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[23] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_num_symbols, __pyx_k_4_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[23])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 973, 58};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_source};
    __pyx_mstate_global->__pyx_codeobj_tab[24] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_write, __pyx_k_T_1_q_6_t1_Jar_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[24])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 1, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 995, 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_sep, __pyx_mstate->__pyx_n_u_ptr, __pyx_mstate->__pyx_n_u_source_2, __pyx_mstate->__pyx_n_u_sep_2, __pyx_mstate->__pyx_n_u_result};
    __pyx_mstate_global->__pyx_codeobj_tab[25] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_write_text, __pyx_k_a_T_1_q_xq_Qiq_t1_Jar_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[25])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1020, 53};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[26] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_write_to_string, __pyx_k_T_1_6_t1_Jaq_6_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[26])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1118, 70};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_symbol, __pyx_mstate->__pyx_n_u_key};
    __pyx_mstate_global->__pyx_codeobj_tab[27] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_add_symbol, __pyx_k_8_Fa_1_t6_Zq_Zq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[27])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1146, 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_symbols};
    __pyx_mstate_global->__pyx_codeobj_tab[28] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_add_table, __pyx_k_q_w_9AV1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[28])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1163, 33};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_new_name};
    __pyx_mstate_global->__pyx_codeobj_tab[29] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_name, __pyx_k_Fa_HAQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[29])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1211, 71};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_symbols_2, __pyx_mstate->__pyx_n_u_source_2};
    __pyx_mstate_global->__pyx_codeobj_tab[30] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read, __pyx_k_q_f_E_xt3c_Jar_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[30])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 1, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1234, 85};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_sep, __pyx_mstate->__pyx_n_u_symbols_2, __pyx_mstate->__pyx_n_u_source_2, __pyx_mstate->__pyx_n_u_sep_2};
    __pyx_mstate_global->__pyx_codeobj_tab[31] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read_text, __pyx_k_q_xq_f_IQiq_xt3c_Jar_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[31])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1260, 72};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_input_table, __pyx_mstate->__pyx_n_u_symbols_2, __pyx_mstate->__pyx_n_u_source_2};
    __pyx_mstate_global->__pyx_codeobj_tab[32] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read_fst, __pyx_k_q_fD_q_xt3c_Jar_31_AT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[32])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1324, 64};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[33] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read_SymbolTable_from_string, __pyx_k_A_F_Qha_XT_Cq_AQ_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[33])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1338, 47};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_symbols};
    __pyx_mstate_global->__pyx_codeobj_tab[34] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_compact_symbol_table, __pyx_k_7_A_6_q_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[34])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1357, 63};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_lhs, __pyx_mstate->__pyx_n_u_rhs};
    __pyx_mstate_global->__pyx_codeobj_tab[35] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_merge_symbol_table, __pyx_k_s_A_s_A_6_avZvZq_4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[35])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[36] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[36])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[37] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[37])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1481, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[38] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_k_d2B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[38])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1484, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[39] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_arc_type, __pyx_k_HD_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[39])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1495, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[40] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_weight_type, __pyx_k_HD_Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[40])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1506, 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flags_2};
    __pyx_mstate_global->__pyx_codeobj_tab[41] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_flags, __pyx_k_t84r_q_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[41])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1526, 26};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mask, __pyx_mstate->__pyx_n_u_mask_2};
    __pyx_mstate_global->__pyx_codeobj_tab[42] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_properties, __pyx_k_a_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[42])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1537, 66};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_source_2, __pyx_mstate->__pyx_n_u_mapper_2};
    __pyx_mstate_global->__pyx_codeobj_tab[43] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read, __pyx_k_q_U_1_wd_S_Jar_QgXQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[43])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1561, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[44] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read_from_string, __pyx_k__42, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[44])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1579, 54};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_source};
    __pyx_mstate_global->__pyx_codeobj_tab[45] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_write, __pyx_k_M_hd_F_1_Q_j_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[45])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1599, 51};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[46] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_write_to_string, __pyx_k_hd_L_Q_j_V4q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[46])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1619, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[47] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_input_symbols, __pyx_k_t84r_c_A_AT1Fa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[47])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1629, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[48] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_output_symbols, __pyx_k_t84r_s_Q_AT1Fa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[48])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1646, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_symbols};
    __pyx_mstate_global->__pyx_codeobj_tab[49] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_input_symbols, __pyx_k_1A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[49])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1670, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_symbols};
    __pyx_mstate_global->__pyx_codeobj_tab[50] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_output_symbols, __pyx_k_AQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[50])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1694, 59};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[51] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read_EncodeMapper_from_string, __pyx_k_A_axq_WD_3a_AQ_1G81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[51])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1750, 206};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sstrm, __pyx_mstate->__pyx_n_u_acceptor, __pyx_mstate->__pyx_n_u_e};
    __pyx_mstate_global->__pyx_codeobj_tab[52] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_repr_svg, __pyx_k_e4r_D_F_avT_5_Bm1_5_BnA_1F_a_m1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[52])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1798, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[53] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reduce, __pyx_k_4_7q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[53])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1807, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[54] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_arc_type, __pyx_k_E_Rxq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[54])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1818, 15};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[55] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_arcs, __pyx_k_q_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[55])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1832, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[56] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_k_Q_avT, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[56])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {18, 0, 0, 18, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1840, 264};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_isymbols, __pyx_mstate->__pyx_n_u_osymbols, __pyx_mstate->__pyx_n_u_ssymbols, __pyx_mstate->__pyx_n_u_acceptor, __pyx_mstate->__pyx_n_u_title, __pyx_mstate->__pyx_n_u_width, __pyx_mstate->__pyx_n_u_height, __pyx_mstate->__pyx_n_u_portrait, __pyx_mstate->__pyx_n_u_vertical, __pyx_mstate->__pyx_n_u_ranksep, __pyx_mstate->__pyx_n_u_nodesep, __pyx_mstate->__pyx_n_u_fontsize, __pyx_mstate->__pyx_n_u_precision, __pyx_mstate->__pyx_n_u_float_format, __pyx_mstate->__pyx_n_u_show_weight_one, __pyx_mstate->__pyx_n_u_format};
    __pyx_mstate_global->__pyx_codeobj_tab[57] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_draw, __pyx_k_D_q_Qa_D_T_y_q_8_Q_D_T_y_q_8_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[57])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1927, 68};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[58] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_final, __pyx_k_86_Qd_t2V1A_t7_M_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[58])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1948, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[59] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_fst_type, __pyx_k_E_Rxq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[59])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1959, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[60] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_input_symbols, __pyx_k_t5_Bm3c_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[60])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1969, 37};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_result_2};
    __pyx_mstate_global->__pyx_codeobj_tab[61] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_num_states_if_known, __pyx_k_D_T_3DA_6_vV_XQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[61])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1978, 50};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[62] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_num_arcs, __pyx_k_d_t2XQa_v_d_M_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[62])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2000, 51};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[63] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_num_input_epsilons, __pyx_k_d_t2_aq_v_d_M_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[63])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2022, 51};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[64] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_num_output_epsilons, __pyx_k_d_t2_q_v_d_M_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[64])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2044, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[65] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_output_symbols, __pyx_k_t5_BnCs_1D, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[65])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2054, 168};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_isymbols, __pyx_mstate->__pyx_n_u_osymbols, __pyx_mstate->__pyx_n_u_ssymbols, __pyx_mstate->__pyx_n_u_acceptor, __pyx_mstate->__pyx_n_u_show_weight_one, __pyx_mstate->__pyx_n_u_missing_sym};
    __pyx_mstate_global->__pyx_codeobj_tab[66] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_print, __pyx_k_4A_a_0_D_T_y_q_8_Q_D_T_y_q_8_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[66])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2109, 28};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mask, __pyx_mstate->__pyx_n_u_test, __pyx_mstate->__pyx_n_u_mask_2};
    __pyx_mstate_global->__pyx_codeobj_tab[67] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_properties, __pyx_k_a_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[67])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2120, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_source};
    __pyx_mstate_global->__pyx_codeobj_tab[68] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read, __pyx_k_9AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[68])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2138, 14};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[69] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read_from_string, __pyx_k__43, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[69])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2156, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[70] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_start, __pyx_k_T_d_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[70])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2165, 13};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[71] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_states, __pyx_k__44, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[71])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2176, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[72] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_verify, __pyx_k_q_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[72])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2188, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[73] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_weight_type, __pyx_k_T_d_Kq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[73])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2200, 54};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_source};
    __pyx_mstate_global->__pyx_codeobj_tab[74] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_write, __pyx_k_q_E_RvQa_t1_Jar_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[74])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2221, 51};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[75] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_write_to_string, __pyx_k_E_RvQha_t1_Jaq_6_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[75])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2271, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_arc};
    __pyx_mstate_global->__pyx_codeobj_tab[76] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_add_arc, __pyx_k_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[76])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2291, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[77] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_add_state, __pyx_k_t6_Ry_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[77])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2305, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[78] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_add_states, __pyx_k_Bj, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[78])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2328, 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_sort_type};
    __pyx_mstate_global->__pyx_codeobj_tab[79] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_arcsort, __pyx_k_a_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[79])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2355, 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_closure_type};
    __pyx_mstate_global->__pyx_codeobj_tab[80] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_closure, __pyx_k_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[80])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2383, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fst2};
    __pyx_mstate_global->__pyx_codeobj_tab[81] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_concat, __pyx_k_1_3, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[81])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2407, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[82] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_connect, __pyx_k_1_4, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[82])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2427, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mapper};
    __pyx_mstate_global->__pyx_codeobj_tab[83] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_decode, __pyx_k_1_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[83])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2456, 23};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[84] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_delete_arcs, __pyx_k_0_QgQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[84])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2494, 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_states};
    __pyx_mstate_global->__pyx_codeobj_tab[85] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_delete_states, __pyx_k_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[85])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2518, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_mapper};
    __pyx_mstate_global->__pyx_codeobj_tab[86] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_encode, __pyx_k_1_6, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[86])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2544, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[87] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_invert, __pyx_k_1_7, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[87])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2567, 26};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_allow_nondet};
    __pyx_mstate_global->__pyx_codeobj_tab[88] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_minimize, __pyx_k_Gq4_7_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[88])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2596, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[89] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_mutable_arcs, __pyx_k_avQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[89])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2610, 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[90] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_mutable_input_symbols, __pyx_k_t6_R_3c_4_B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[90])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2620, 42};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[91] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_mutable_output_symbols, __pyx_k_t6_R_Cs_4_B, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[91])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2630, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[92] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_num_states, __pyx_k_F_b_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[92])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2646, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_project_type};
    __pyx_mstate_global->__pyx_codeobj_tab[93] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_project, __pyx_k_1_8, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[93])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2677, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_nstate, __pyx_mstate->__pyx_n_u_weight};
    __pyx_mstate_global->__pyx_codeobj_tab[94] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_prune, __pyx_k_q_xq_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[94])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2711, 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_remove_total_weight, __pyx_mstate->__pyx_n_u_reweight_type};
    __pyx_mstate_global->__pyx_codeobj_tab[95] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_push, __pyx_k_4_aw_1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[95])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2758, 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_ipairs, __pyx_mstate->__pyx_n_u_opairs};
    __pyx_mstate_global->__pyx_codeobj_tab[96] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_relabel_pairs, __pyx_k_a_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[96])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {9, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2818, 65};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_old_isymbols, __pyx_mstate->__pyx_n_u_new_isymbols, __pyx_mstate->__pyx_n_u_unknown_isymbol, __pyx_mstate->__pyx_n_u_attach_new_isymbols, __pyx_mstate->__pyx_n_u_old_osymbols, __pyx_mstate->__pyx_n_u_new_osymbols, __pyx_mstate->__pyx_n_u_unknown_osymbol, __pyx_mstate->__pyx_n_u_attach_new_osymbols};
    __pyx_mstate_global->__pyx_codeobj_tab[97] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_relabel_tables, __pyx_k_2323_2323_D_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[97])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2878, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[98] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reserve_arcs, __pyx_k_awa_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[98])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2901, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_n};
    __pyx_mstate_global->__pyx_codeobj_tab[99] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reserve_states, __pyx_k_1_9, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[99])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2926, 23};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_potentials, __pyx_mstate->__pyx_n_u_reweight_type};
    __pyx_mstate_global->__pyx_codeobj_tab[100] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reweight, __pyx_k_q_q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[100])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {6, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 2971, 41};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_queue_type, __pyx_mstate->__pyx_n_u_connect, __pyx_mstate->__pyx_n_u_weight, __pyx_mstate->__pyx_n_u_nstate, __pyx_mstate->__pyx_n_u_delta};
    __pyx_mstate_global->__pyx_codeobj_tab[101] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_rmepsilon, __pyx_k_1L_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[101])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3010, 23};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state, __pyx_mstate->__pyx_n_u_weight};
    __pyx_mstate_global->__pyx_codeobj_tab[102] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_final, __pyx_k_A_1G1_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[102])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3039, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_symbols};
    __pyx_mstate_global->__pyx_codeobj_tab[103] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_input_symbols, __pyx_k_1A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[103])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3062, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_symbols};
    __pyx_mstate_global->__pyx_codeobj_tab[104] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_output_symbols, __pyx_k_AQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[104])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3079, 43};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_props, __pyx_mstate->__pyx_n_u_mask, __pyx_mstate->__pyx_n_u_props_2, __pyx_mstate->__pyx_n_u_mask_2};
    __pyx_mstate_global->__pyx_codeobj_tab[105] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_properties, __pyx_k_5_a_BnAXQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[105])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3106, 18};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[106] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_start, __pyx_k_1A_1_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[106])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3131, 16};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[107] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_topsort, __pyx_k_1_10, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[107])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 3147, 57};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_fsts2, __pyx_mstate->__pyx_n_u_fst2_2, __pyx_mstate->__pyx_n_u_fsts2_2};
    __pyx_mstate_global->__pyx_codeobj_tab[108] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_union, __pyx_k_JauE_Q_q_F_d_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[108])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3238, 63};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_source};
    __pyx_mstate_global->__pyx_codeobj_tab[109] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read_Fst, __pyx_k_Qa_Qa_U_c_A_AR_1E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[109])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3248, 58};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_state};
    __pyx_mstate_global->__pyx_codeobj_tab[110] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_read_Fst_from_string, __pyx_k_A_1HA_U_c_A_AQ_1E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[110])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3406, 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[111] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_copy, __pyx_k_3at9D_Yd, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[111])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[112] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[112])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[113] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[113])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3486, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[114] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_done, __pyx_k_T_T_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[114])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3498, 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flags_2};
    __pyx_mstate_global->__pyx_codeobj_tab[115] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_flags, __pyx_k_t4t2V1_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[115])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3512, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[116] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_next, __pyx_k_d_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[116])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3521, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[117] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_position, __pyx_k_T_T_9A_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[117])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3535, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[118] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_k_d_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[118])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3544, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_a};
    __pyx_mstate_global->__pyx_codeobj_tab[119] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_seek, __pyx_k_d_E_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[119])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3556, 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_mask, __pyx_mstate->__pyx_n_u_flags_2, __pyx_mstate->__pyx_n_u_mask_2};
    __pyx_mstate_global->__pyx_codeobj_tab[120] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_flags, __pyx_k_q_Q_d_IQha, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[120])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3574, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[121] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_value, __pyx_k_t5_Jaq_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[121])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[122] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[122])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[123] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[123])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3629, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[124] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_done, __pyx_k_T_d_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[124])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3641, 32};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flags_2};
    __pyx_mstate_global->__pyx_codeobj_tab[125] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_flags, __pyx_k_t5_BfA_1A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[125])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3655, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[126] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_next, __pyx_k_t2U, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[126])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3664, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[127] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_position, __pyx_k_T_d_IQ_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[127])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3678, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[128] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_k_t2V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[128])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3687, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_a};
    __pyx_mstate_global->__pyx_codeobj_tab[129] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_seek, __pyx_k_t2U_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[129])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3699, 38};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_flags, __pyx_mstate->__pyx_n_u_mask, __pyx_mstate->__pyx_n_u_flags_2, __pyx_mstate->__pyx_n_u_mask_2};
    __pyx_mstate_global->__pyx_codeobj_tab[130] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_flags, __pyx_k_q_Q_t2Yaxq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[130])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3714, 44};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_arc};
    __pyx_mstate_global->__pyx_codeobj_tab[131] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_set_value, __pyx_k_t5_Jaq_t2YavS, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[131])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3734, 31};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[132] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_value, __pyx_k_t5_Jaq_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[132])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[133] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[133])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[134] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[134])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3782, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[135] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_done, __pyx_k_T_T_5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[135])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3794, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[136] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_next, __pyx_k_d_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[136])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3803, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[137] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_k_d_F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[137])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3816, 37};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[138] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_value, __pyx_k_t4t2U_Jaq_4wa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[138])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[139] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[139])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[140] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[140])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3855, 34};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_map_type, __pyx_mstate->__pyx_n_u_power, __pyx_mstate->__pyx_n_u_weight};
    __pyx_mstate_global->__pyx_codeobj_tab[141] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_arcmap, __pyx_k_P_QfG_WA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[141])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3902, 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst1, __pyx_mstate->__pyx_n_u_ifst2, __pyx_mstate->__pyx_n_u_compose_filter, __pyx_mstate->__pyx_n_u_connect};
    __pyx_mstate_global->__pyx_codeobj_tab[142] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_compose, __pyx_k_0_vQ_AU_1_vQ_AQ_0_q_e5_A_e5_A_T, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[142])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3942, 74};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_fst_type};
    __pyx_mstate_global->__pyx_codeobj_tab[143] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_convert, __pyx_k_Q_1_xq_d_U_c_A_AR_1E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[143])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3969, 159};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_det_type, __pyx_mstate->__pyx_n_u_nstate, __pyx_mstate->__pyx_n_u_subsequential_label, __pyx_mstate->__pyx_n_u_weight, __pyx_mstate->__pyx_n_u_increment_subsequential_label};
    __pyx_mstate_global->__pyx_codeobj_tab[144] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_determinize, __pyx_k_09_AD_vQ_AT_9_l_W_q_E_Qb_vQ_1F, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[144])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4029, 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst1, __pyx_mstate->__pyx_n_u_ifst2, __pyx_mstate->__pyx_n_u_compose_filter, __pyx_mstate->__pyx_n_u_connect};
    __pyx_mstate_global->__pyx_codeobj_tab[145] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_difference, __pyx_k_2_vQ_AU_1_vQ_AQ_q_6_e4q_e4q_A_d, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[145])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4070, 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_nstate, __pyx_mstate->__pyx_n_u_subsequential_label, __pyx_mstate->__pyx_n_u_weight};
    __pyx_mstate_global->__pyx_codeobj_tab[146] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_disambiguate, __pyx_k_01_2_vQ_AT_9_l_56_vQ_AV4xuD_F_x, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[146])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4114, 75};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_eps_norm_type};
    __pyx_mstate_global->__pyx_codeobj_tab[147] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_epsnormalize, __pyx_k_6a_vQ_AT_6axq_AV4xuD_A_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[147])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4143, 34};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst1, __pyx_mstate->__pyx_n_u_ifst2, __pyx_mstate->__pyx_n_u_delta};
    __pyx_mstate_global->__pyx_codeobj_tab[148] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_equal, __pyx_k_6a_fAV5_e81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[148])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4165, 63};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst1, __pyx_mstate->__pyx_n_u_ifst2, __pyx_mstate->__pyx_n_u_delta};
    __pyx_mstate_global->__pyx_codeobj_tab[149] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_equivalent, __pyx_k_1_QfE_uA_U_Q_AQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[149])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4196, 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst1, __pyx_mstate->__pyx_n_u_ifst2, __pyx_mstate->__pyx_n_u_compose_filter, __pyx_mstate->__pyx_n_u_connect};
    __pyx_mstate_global->__pyx_codeobj_tab[150] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_intersect, __pyx_k_vQ_AU_1_vQ_AQ_q_U_a_U_a_t1_T_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[150])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4235, 34};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst1, __pyx_mstate->__pyx_n_u_ifst2, __pyx_mstate->__pyx_n_u_delta};
    __pyx_mstate_global->__pyx_codeobj_tab[151] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_isomorphic, __pyx_k_1_k_XV5, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[151])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 4, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4260, 88};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_nstate, __pyx_mstate->__pyx_n_u_weight};
    __pyx_mstate_global->__pyx_codeobj_tab[152] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_prune, __pyx_k_vQ_AT_9_l_QfD_T_Yha_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[152])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4293, 113};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_push_weights, __pyx_mstate->__pyx_n_u_push_labels, __pyx_mstate->__pyx_n_u_remove_common_affix, __pyx_mstate->__pyx_n_u_remove_total_weight, __pyx_mstate->__pyx_n_u_reweight_type};
    __pyx_mstate_global->__pyx_codeobj_tab[153] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_push, __pyx_k_0_0_N_vQ_AT_q_2_81A_AV4xuD_G7_x, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[153])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4349, 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst1, __pyx_mstate->__pyx_n_u_ifst2, __pyx_mstate->__pyx_n_u_npath, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_select, __pyx_mstate->__pyx_n_u_max_length, __pyx_mstate->__pyx_n_u_seed};
    __pyx_mstate_global->__pyx_codeobj_tab[154] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_randequivalent, __pyx_k_DH_6_Qhaq_vQ_31A45454545_81A_oQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[154])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4401, 131};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_npath, __pyx_mstate->__pyx_n_u_select, __pyx_mstate->__pyx_n_u_max_length, __pyx_mstate->__pyx_n_u_weighted, __pyx_mstate->__pyx_n_u_remove_total_weight, __pyx_mstate->__pyx_n_u_seed};
    __pyx_mstate_global->__pyx_codeobj_tab[155] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_randgen, __pyx_k_CGq_23_Qhaq_vQ_2_134343434_vQ_A, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[155])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 5, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4453, 168};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_pairs, __pyx_mstate->__pyx_n_u_call_arc_labeling, __pyx_mstate->__pyx_n_u_return_arc_labeling, __pyx_mstate->__pyx_n_u_epsilon_on_replace, __pyx_mstate->__pyx_n_u_return_label};
    __pyx_mstate_global->__pyx_codeobj_tab[156] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_replace, __pyx_k_12_P_xz_Jd_AXU_t1_vQ_AV1BgXQ_aq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[156])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4514, 61};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_require_superinitial};
    __pyx_mstate_global->__pyx_codeobj_tab[157] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reverse, __pyx_k_Q_vQ_AT_q_d_t4q_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[157])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {5, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4565, 69};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_nstate, __pyx_mstate->__pyx_n_u_queue_type, __pyx_mstate->__pyx_n_u_reverse, __pyx_mstate->__pyx_n_u_distance, __pyx_mstate->__pyx_n_u_weight};
    __pyx_mstate_global->__pyx_codeobj_tab[158] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_shortestdistance, __pyx_k_8_1F_7_a_U_b_4vYa_j, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[158])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {7, 0, 0, 7, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4602, 133};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_delta, __pyx_mstate->__pyx_n_u_nshortest, __pyx_mstate->__pyx_n_u_nstate, __pyx_mstate->__pyx_n_u_queue_type, __pyx_mstate->__pyx_n_u_unique, __pyx_mstate->__pyx_n_u_weight};
    __pyx_mstate_global->__pyx_codeobj_tab[159] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_shortestpath, __pyx_k_0101_vQ_AT_9_l_vQ_1_AV4xuD_F_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[159])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4657, 21};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst, __pyx_mstate->__pyx_n_u_map_type};
    __pyx_mstate_global->__pyx_codeobj_tab[160] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_statemap, __pyx_k_Qiy_a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[160])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4683, 56};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_ifst};
    __pyx_mstate_global->__pyx_codeobj_tab[161] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_synchronize, __pyx_k_vQ_AT_1F_he4q_xq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[161])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4787, 118};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[162] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_compile, __pyx_k_A_a_a_a_a_a_a_a_a_a_vQ_a_uD_3a, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[162])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4819, 56};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_expression};
    __pyx_mstate_global->__pyx_codeobj_tab[163] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_write, __pyx_k_t5_c_U_s_Q_7_1_is, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[163])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[164] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[164])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[165] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[165])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 6, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS), 4866, 87};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_sources, __pyx_mstate->__pyx_n_u_sources_2, __pyx_mstate->__pyx_n_u_tfar, __pyx_mstate->__pyx_n_u_reader, __pyx_mstate->__pyx_n_u_source};
    __pyx_mstate_global->__pyx_codeobj_tab[166] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_open, __pyx_k_1M_j_Qa_uD_3a_Jar_IXQa_T_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[166])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4895, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[167] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_arc_type, __pyx_k_T_Rxq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[167])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4904, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[168] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_done, __pyx_k_T_RuA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[168])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4916, 19};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[169] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_error, __pyx_k_4xt2V1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[169])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4927, 25};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[170] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_far_type, __pyx_k_hd_E, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[170])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4931, 33};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key};
    __pyx_mstate_global->__pyx_codeobj_tab[171] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_find, __pyx_k_xq_T_RuAQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[171])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4948, 46};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[172] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_get_fst, __pyx_k_6_6_XT_q_Qe81, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[172])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4962, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[173] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_get_key, __pyx_k_T_Rwa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[173])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4974, 20};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[174] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_next, __pyx_k_b_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[174])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 4983, 17};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[175] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_reset, __pyx_k_BfA, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[175])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[176] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[176])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[177] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[177])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 9, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5036, 112};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_cls, __pyx_mstate->__pyx_n_u_source, __pyx_mstate->__pyx_n_u_arc_type, __pyx_mstate->__pyx_n_u_far_type, __pyx_mstate->__pyx_n_u_tfar, __pyx_mstate->__pyx_n_u_source_2, __pyx_mstate->__pyx_n_u_arc_type_2, __pyx_mstate->__pyx_n_u_far_type_2, __pyx_mstate->__pyx_n_u_writer};
    __pyx_mstate_global->__pyx_codeobj_tab[178] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_create, __pyx_k_8_4_q_HAQ_axq_q_uD_3a_Jar_IXQa, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[178])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 3, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5081, 55};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_key, __pyx_mstate->__pyx_n_u_ifst};
    __pyx_mstate_global->__pyx_codeobj_tab[179] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_add, __pyx_k_xq_HD_avV4q_t1_Jaq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[179])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5106, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[180] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_arc_type, __pyx_k_T_Rxq, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[180])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5115, 22};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[181] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_error, __pyx_k_T_RvQ, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[181])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 5127, 27};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[182] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_pywrapfst_pyx, __pyx_mstate->__pyx_n_u_far_type, __pyx_k_hd_E_2, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[182])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 1, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 1, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self};
    __pyx_mstate_global->__pyx_codeobj_tab[183] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_reduce_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[183])) goto bad;
  }
  {
    const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 3, 9};
    PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_pyx_state};
    __pyx_mstate_global->__pyx_codeobj_tab[184] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_stringsource, __pyx_mstate->__pyx_n_u_setstate_cython, __pyx_k_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[184])) goto bad;
  }
  Py_DECREF(tuple_dedup_map);
  return 0;
  bad:
  Py_DECREF(tuple_dedup_map);
  return -1;
}
/* #### Code section: init_globals ### */

static int __Pyx_InitGlobals(void) {
  /* PythonCompatibility.init */
  if (likely(__Pyx_init_co_variables() == 0)); else

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  /* CachedMethodType.init */
  #if CYTHON_COMPILING_IN_LIMITED_API
{
    PyObject *typesModule=NULL;
    typesModule = PyImport_ImportModule("types");
    if (typesModule) {
        __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
        Py_DECREF(typesModule);
    }
} // error handling follows
#endif

if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)

  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_pragmas ### */
#ifdef _MSC_VER
#pragma warning( push )
/* Warning 4127: conditional expression is constant
 * Cython uses constant conditional expressions to allow in inline functions to be optimized at
 * compile-time, so this warning is not useful
 */
#pragma warning( disable : 4127 )
#endif



/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    int result;
    PyObject *exc_type;
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *current_exception = tstate->current_exception;
    if (unlikely(!current_exception)) return 0;
    exc_type = (PyObject*) Py_TYPE(current_exception);
    if (exc_type == err) return 1;
#else
    exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
#endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(exc_type);
    #endif
    if (unlikely(PyTuple_Check(err))) {
        result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    } else {
        result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
    }
    #if CYTHON_AVOID_BORROWED_REFS
    Py_DECREF(exc_type);
    #endif
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject *tmp_value;
    assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
    if (value) {
        #if CYTHON_COMPILING_IN_CPYTHON
        if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
        #endif
            PyException_SetTraceback(value, tb);
    }
    tmp_value = tstate->current_exception;
    tstate->current_exception = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
#else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
#if PY_VERSION_HEX >= 0x030C00A6
    PyObject* exc_value;
    exc_value = tstate->current_exception;
    tstate->current_exception = 0;
    *value = exc_value;
    *type = NULL;
    *tb = NULL;
    if (exc_value) {
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        #if CYTHON_COMPILING_IN_CPYTHON
        *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
        Py_XINCREF(*tb);
        #else
        *tb = PyException_GetTraceback(exc_value);
        #endif
    }
#else
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#endif
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
#if __PYX_LIMITED_VERSION_HEX < 0x030d0000
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
    (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
    return result;
#else
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
#endif
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
            "name '%U' is not defined", name);
    }
    return result;
}

/* PyObjectFormatAndDecref */
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatSimpleAndDecref(PyObject* s, PyObject* f) {
    if (unlikely(!s)) return NULL;
    if (likely(PyUnicode_CheckExact(s))) return s;
    return __Pyx_PyObject_FormatAndDecref(s, f);
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FormatAndDecref(PyObject* s, PyObject* f) {
    PyObject *result;
    if (unlikely(!s)) return NULL;
    result = PyObject_Format(s, f);
    Py_DECREF(s);
    return result;
}

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject** values, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    if (max_char > 1114111) max_char = 1114111;
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - result_ulength < 0))
        goto overflow;
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = values[i];
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (__Pyx_PyUnicode_READY(uval) == (-1))
            goto bad;
        #endif
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(ulength < 0)) goto bad;
        #endif
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if PY_VERSION_HEX >= 0x030d0000
            if (unlikely(PyUnicode_CopyCharacters(result_uval, char_pos, uval, 0, ulength) < 0)) goto bad;
            #elif CYTHON_COMPILING_IN_CPYTHON || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    Py_ssize_t i;
    PyObject *result = NULL;
    PyObject *value_tuple = PyTuple_New(value_count);
    if (unlikely(!value_tuple)) return NULL;
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    for (i=0; i<value_count; i++) {
        if (__Pyx_PyTuple_SET_ITEM(value_tuple, i, values[i]) != (0)) goto bad;
        Py_INCREF(values[i]);
    }
    result = PyUnicode_Join(__pyx_mstate_global->__pyx_empty_unicode, value_tuple);
bad:
    Py_DECREF(value_tuple);
    return result;
#endif
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject *const *args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject *const *args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
    PyObject *kwdefs;
    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 (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
        return NULL;
    }
    if (
            co->co_kwonlyargcount == 0 &&
            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);
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall(" 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 = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
    self = __Pyx_CyOrPyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall(" 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

/* PyObjectFastCall */
#if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result = 0;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  bad:
    Py_DECREF(argstuple);
    return result;
}
#endif
#if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  #if PY_VERSION_HEX < 0x03090000
    #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  #elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
    PyTypeObject *tp = Py_TYPE(callable);
    #if defined(__Pyx_CyFunction_USED)
    if (__Pyx_CyFunction_CheckExact(callable)) {
        return __Pyx_CyFunction_func_vectorcall(callable);
    }
    #endif
    if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
        return NULL;
    }
    assert(PyCallable_Check(callable));
    Py_ssize_t offset = tp->tp_vectorcall_offset;
    assert(offset > 0);
    vectorcallfunc ptr;
    memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
    return ptr;
}
  #else
    #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  #endif
#endif
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
            return __Pyx_PyObject_CallMethO(func, NULL);
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
            return __Pyx_PyObject_CallMethO(func, args[0]);
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    if (kwargs == NULL) {
        #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
        vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
        if (f) {
            return f(func, args, _nargs, NULL);
        }
        #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
        if (__Pyx_CyFunction_CheckExact(func)) {
            __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
            if (f) return f(func, args, _nargs, NULL);
        }
        #elif CYTHON_COMPILING_IN_LIMITED_API && CYTHON_VECTORCALL
        return PyObject_Vectorcall(func, args, _nargs, NULL);
        #endif
    }
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
    }
    #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
    #else
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
    #endif
}

/* RaiseException */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if PY_VERSION_HEX >= 0x030C00A6
        PyException_SetTraceback(value, tb);
#elif CYTHON_FAST_THREAD_STATE
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#else
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        if (!PyErr_Occurred())
            PyErr_SetNone(PyExc_NameError);
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
    PyErr_Clear();
#elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
    if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return result;
    }
#else
    result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* TupleAndListFromArray */
#if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    Py_ssize_t i;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    for (i = 0; i < n; i++) {
        if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < 0)) {
            Py_DECREF(res);
            return NULL;
        }
        Py_INCREF(src[i]);
    }
    return res;
}
#elif CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
        !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length, length2;
        int kind;
        void *data1, *data2;
        #if !CYTHON_COMPILING_IN_LIMITED_API
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        #endif
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length < 0)) return -1;
        #endif
        length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(length2 < 0)) return -1;
        #endif
        if (length != length2) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    return (equals == Py_EQ);
return_ne:
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
    #if !CYTHON_ASSUME_SAFE_SIZE
    if (unlikely(n == -1)) return NULL;
    #endif
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        if (s == namei) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!namei)) return NULL;
        #endif
        int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;
            return kwvalues[i];
        }
    }
    return NULL;
}
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
    Py_ssize_t i, nkwargs;
    PyObject *dict;
#if !CYTHON_ASSUME_SAFE_SIZE
    nkwargs = PyTuple_Size(kwnames);
    if (unlikely(nkwargs < 0)) return NULL;
#else
    nkwargs = PyTuple_GET_SIZE(kwnames);
#endif
    dict = PyDict_New();
    if (unlikely(!dict))
        return NULL;
    for (i=0; i<nkwargs; i++) {
#if !CYTHON_ASSUME_SAFE_MACROS
        PyObject *key = PyTuple_GetItem(kwnames, i);
        if (!key) goto bad;
#else
        PyObject *key = PyTuple_GET_ITEM(kwnames, i);
#endif
        if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
            goto bad;
    }
    return dict;
bad:
    Py_DECREF(dict);
    return NULL;
}
#endif
#endif

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
}

/* UnpackUnboundCMethod */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
    PyObject *result;
    PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
    if (unlikely(!selfless_args)) return NULL;
    result = PyObject_Call(method, selfless_args, kwargs);
    Py_DECREF(selfless_args);
    return result;
}
#elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
        return _PyObject_Vectorcall
            (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
}
#else
static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
    return
#if PY_VERSION_HEX < 0x03090000
    _PyObject_Vectorcall
#else
    PyObject_Vectorcall
#endif
        (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
}
#endif
static PyMethodDef __Pyx_UnboundCMethod_Def = {
     "CythonUnboundCMethod",
     __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
     METH_VARARGS | METH_KEYWORDS,
#else
     METH_FASTCALL | METH_KEYWORDS,
#endif
     NULL
};
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method, *result=NULL;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    result = method;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    } else
#endif
#if CYTHON_COMPILING_IN_PYPY
#else
    if (PyCFunction_Check(method))
#endif
    {
        PyObject *self;
        int self_found;
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        self = PyObject_GetAttrString(method, "__self__");
        if (!self) {
            PyErr_Clear();
        }
#else
        self = PyCFunction_GET_SELF(method);
#endif
        self_found = (self && self != Py_None);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
        Py_XDECREF(self);
#endif
        if (self_found) {
            PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
            if (unlikely(!unbound_method)) return -1;
            Py_DECREF(method);
            result = unbound_method;
        }
    }
#if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    if (unlikely(target->method)) {
        Py_DECREF(result);
    } else
#endif
    target->method = result;
    return 0;
}

/* CallUnboundCMethod2 */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
    if (likely(was_initialized == 2 && cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
        }
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
    }
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    else if (unlikely(was_initialized == 1)) {
        __Pyx_CachedCFunction tmp_cfunc = {
#ifndef __cplusplus
            0
#endif
        };
        tmp_cfunc.type = cfunc->type;
        tmp_cfunc.method_name = cfunc->method_name;
        return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
    }
#endif
    PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
    __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
    return result;
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        PyObject *result = NULL;
        PyObject *args = PyTuple_New(2);
        if (unlikely(!args)) return NULL;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
        else
            result = __Pyx_CallCFunction(cfunc, self, args);
        Py_DECREF(args);
        return result;
    }
#endif
    {
        PyObject *args[4] = {NULL, self, arg1, arg2};
        return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
    }
}

/* ParseKeywords */
static int __Pyx_ValidateDuplicatePosArgs(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char* function_name)
{
    PyObject ** const *name = argnames;
    while (name != first_kw_arg) {
        PyObject *key = **name;
        int found = PyDict_Contains(kwds, key);
        if (unlikely(found)) {
            if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
            goto bad;
        }
        name++;
    }
    return 0;
bad:
    return -1;
}
#if CYTHON_USE_UNICODE_INTERNALS
static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
    int kind;
    Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
    if (len != PyUnicode_GET_LENGTH(s2)) return 0;
    kind = PyUnicode_KIND(s1);
    if (kind != PyUnicode_KIND(s2)) return 0;
    const void *data1 = PyUnicode_DATA(s1);
    const void *data2 = PyUnicode_DATA(s2);
    return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
}
#endif
static int __Pyx_MatchKeywordArg_str(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    #if CYTHON_USE_UNICODE_INTERNALS
    Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
    if (unlikely(key_hash == -1)) {
        key_hash = PyObject_Hash(key);
        if (unlikely(key_hash == -1))
            goto bad;
    }
    #endif
    name = first_kw_arg;
    while (*name) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) {
                *index_found = (size_t) (name - argnames);
                return 1;
            }
        }
        #endif
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        PyObject *name_str = **name;
        #if CYTHON_USE_UNICODE_INTERNALS
        if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
            if (__Pyx_UnicodeKeywordsEqual(name_str, key))
                goto arg_passed_twice;
        }
        #else
        #if CYTHON_ASSUME_SAFE_SIZE
        if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
        #endif
        {
            if (unlikely(name_str == key)) goto arg_passed_twice;
            int cmp = PyUnicode_Compare(name_str, key);
            if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
            if (cmp == 0) goto arg_passed_twice;
        }
        #endif
        name++;
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
bad:
    return -1;
}
static int __Pyx_MatchKeywordArg_nostr(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    PyObject ** const *name;
    if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
    name = first_kw_arg;
    while (*name) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (cmp == 1) {
            *index_found = (size_t) (name - argnames);
            return 1;
        }
        if (unlikely(cmp == -1)) goto bad;
        name++;
    }
    name = argnames;
    while (name != first_kw_arg) {
        int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
        if (unlikely(cmp != 0)) {
            if (cmp == 1) goto arg_passed_twice;
            else goto bad;
        }
        name++;
    }
    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;
bad:
    return -1;
}
static CYTHON_INLINE int __Pyx_MatchKeywordArg(
    PyObject *key,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    size_t *index_found,
    const char *function_name)
{
    return likely(PyUnicode_CheckExact(key)) ?
        __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
        __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
}
static void __Pyx_RejectUnknownKeyword(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject ** const *first_kw_arg,
    const char *function_name)
{
    Py_ssize_t pos = 0;
    PyObject *key = NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(kwds);
    while (PyDict_Next(kwds, &pos, &key, NULL)) {
        PyObject** const *name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (!*name) {
            #if CYTHON_AVOID_BORROWED_REFS
            Py_INCREF(key);
            #endif
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp != 1) {
                if (cmp == 0) {
                    PyErr_Format(PyExc_TypeError,
                        "%s() got an unexpected keyword argument '%U'",
                        function_name, key);
                }
                #if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(key);
                #endif
                break;
            }
            #if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(key);
            #endif
        }
    }
    __Pyx_END_CRITICAL_SECTION();
    assert(PyErr_Occurred());
}
static int __Pyx_ParseKeywordDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t extracted = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    name = first_kw_arg;
    while (*name && num_kwargs > extracted) {
        PyObject * key = **name;
        PyObject *value;
        int found = 0;
        #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        found = PyDict_GetItemRef(kwds, key, &value);
        #else
        value = PyDict_GetItemWithError(kwds, key);
        if (value) {
            Py_INCREF(value);
            found = 1;
        } else {
            if (unlikely(PyErr_Occurred())) goto bad;
        }
        #endif
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            extracted++;
        }
        name++;
    }
    if (num_kwargs > extracted) {
        if (ignore_unknown_kwargs) {
            if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
                goto bad;
        } else {
            __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
            goto bad;
        }
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordDictToDict(
    PyObject *kwds,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject** const *name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    Py_ssize_t len;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
    if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
#endif
    if (PyDict_Update(kwds2, kwds) < 0) goto bad;
    name = first_kw_arg;
    while (*name) {
        PyObject *key = **name;
        PyObject *value;
#if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
        int found = PyDict_Pop(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
        }
#elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
        int found = PyDict_GetItemRef(kwds2, key, &value);
        if (found) {
            if (unlikely(found < 0)) goto bad;
            values[name-argnames] = value;
            if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
        }
#else
    #if CYTHON_COMPILING_IN_CPYTHON
        value = _PyDict_Pop(kwds2, key, kwds2);
    #else
        value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
    #endif
        if (value == kwds2) {
            Py_DECREF(value);
        } else {
            if (unlikely(!value)) goto bad;
            values[name-argnames] = value;
        }
#endif
        name++;
    }
    len = PyDict_Size(kwds2);
    if (len > 0) {
        return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
    } else if (unlikely(len == -1)) {
        goto bad;
    }
    return 0;
bad:
    return -1;
}
static int __Pyx_ParseKeywordsTuple(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    PyObject *key = NULL;
    PyObject** const * name;
    PyObject** const *first_kw_arg = argnames + num_pos_args;
    for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
#if CYTHON_AVOID_BORROWED_REFS
        key = __Pyx_PySequence_ITEM(kwds, pos);
#else
        key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
#endif
#if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(!key)) goto bad;
#endif
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            PyObject *value = kwvalues[pos];
            values[name-argnames] = __Pyx_NewRef(value);
        } else {
            size_t index_found = 0;
            int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
            if (cmp == 1) {
                PyObject *value = kwvalues[pos];
                values[index_found] = __Pyx_NewRef(value);
            } else {
                if (unlikely(cmp == -1)) goto bad;
                if (kwds2) {
                    PyObject *value = kwvalues[pos];
                    if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                } else if (!ignore_unknown_kwargs) {
                    goto invalid_keyword;
                }
            }
        }
        #if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(key);
        key = NULL;
        #endif
    }
    return 0;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    goto bad;
bad:
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(key);
    #endif
    return -1;
}
static int __Pyx_ParseKeywords(
    PyObject *kwds,
    PyObject * const *kwvalues,
    PyObject ** const argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    Py_ssize_t num_kwargs,
    const char* function_name,
    int ignore_unknown_kwargs)
{
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
        return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
    else if (kwds2)
        return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
    else
        return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
}

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

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    __Pyx_TypeName obj_type_name;
    __Pyx_TypeName type_name;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    PyErr_Format(PyExc_TypeError,
                 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
                 obj_type_name, type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
}

/* RejectKeywords */
static void __Pyx_RejectKeywords(const char* function_name, PyObject *kwds) {
    PyObject *key = NULL;
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds))) {
        key = __Pyx_PySequence_ITEM(kwds, 0);
    } else {
        Py_ssize_t pos = 0;
#if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
        if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return;
#endif
        PyDict_Next(kwds, &pos, &key, NULL);
        Py_INCREF(key);
    }
    if (likely(key)) {
        PyErr_Format(PyExc_TypeError,
            "%s() got an unexpected keyword argument '%U'",
            function_name, key);
        Py_DECREF(key);
    }
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

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

/* pybytes_as_double */
static double __Pyx_SlowPyString_AsDouble(PyObject *obj) {
    PyObject *float_value = PyFloat_FromString(obj);
    if (likely(float_value)) {
        double value = __Pyx_PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
    return (double)-1;
}
static const char* __Pyx__PyBytes_AsDouble_Copy(const char* start, char* buffer, Py_ssize_t length) {
    int last_was_punctuation = 1;
    int parse_error_found = 0;
    Py_ssize_t i;
    for (i=0; i < length; i++) {
        char chr = start[i];
        int is_punctuation = (chr == '_') | (chr == '.') | (chr == 'e') | (chr == 'E');
        *buffer = chr;
        buffer += (chr != '_');
        parse_error_found |= last_was_punctuation & is_punctuation;
        last_was_punctuation = is_punctuation;
    }
    parse_error_found |= last_was_punctuation;
    *buffer = '\0';
    return unlikely(parse_error_found) ? NULL : buffer;
}
static double __Pyx__PyBytes_AsDouble_inf_nan(const char* start, Py_ssize_t length) {
    int matches = 1;
    char sign = start[0];
    int is_signed = (sign == '+') | (sign == '-');
    start += is_signed;
    length -= is_signed;
    switch (start[0]) {
        #ifdef Py_NAN
        case 'n':
        case 'N':
            if (unlikely(length != 3)) goto parse_failure;
            matches &= (start[1] == 'a' || start[1] == 'A');
            matches &= (start[2] == 'n' || start[2] == 'N');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_NAN : Py_NAN;
        #endif
        case 'i':
        case 'I':
            if (unlikely(length < 3)) goto parse_failure;
            matches &= (start[1] == 'n' || start[1] == 'N');
            matches &= (start[2] == 'f' || start[2] == 'F');
            if (likely(length == 3 && matches))
                return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
            if (unlikely(length != 8)) goto parse_failure;
            matches &= (start[3] == 'i' || start[3] == 'I');
            matches &= (start[4] == 'n' || start[4] == 'N');
            matches &= (start[5] == 'i' || start[5] == 'I');
            matches &= (start[6] == 't' || start[6] == 'T');
            matches &= (start[7] == 'y' || start[7] == 'Y');
            if (unlikely(!matches)) goto parse_failure;
            return (sign == '-') ? -Py_HUGE_VAL : Py_HUGE_VAL;
        case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9':
            break;
        default:
            goto parse_failure;
    }
    return 0.0;
parse_failure:
    return -1.0;
}
static CYTHON_INLINE int __Pyx__PyBytes_AsDouble_IsSpace(char ch) {
    return (ch == 0x20) | !((ch < 0x9) | (ch > 0xd));
}
CYTHON_UNUSED static double __Pyx__PyBytes_AsDouble(PyObject *obj, const char* start, Py_ssize_t length) {
    double value;
    Py_ssize_t i, digits;
    const char *last = start + length;
    char *end;
    while (__Pyx__PyBytes_AsDouble_IsSpace(*start))
        start++;
    while (start < last - 1 && __Pyx__PyBytes_AsDouble_IsSpace(last[-1]))
        last--;
    length = last - start;
    if (unlikely(length <= 0)) goto fallback;
    value = __Pyx__PyBytes_AsDouble_inf_nan(start, length);
    if (unlikely(value == -1.0)) goto fallback;
    if (value != 0.0) return value;
    digits = 0;
    for (i=0; i < length; digits += start[i++] != '_');
    if (likely(digits == length)) {
        value = PyOS_string_to_double(start, &end, NULL);
    } else if (digits < 40) {
        char number[40];
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) goto fallback;
        value = PyOS_string_to_double(number, &end, NULL);
    } else {
        char *number = (char*) PyMem_Malloc((digits + 1) * sizeof(char));
        if (unlikely(!number)) goto fallback;
        last = __Pyx__PyBytes_AsDouble_Copy(start, number, length);
        if (unlikely(!last)) {
            PyMem_Free(number);
            goto fallback;
        }
        value = PyOS_string_to_double(number, &end, NULL);
        PyMem_Free(number);
    }
    if (likely(end == last) || (value == (double)-1 && PyErr_Occurred())) {
        return value;
    }
fallback:
    return __Pyx_SlowPyString_AsDouble(obj);
}

/* pynumber_float */
static CYTHON_INLINE PyObject* __Pyx__PyNumber_Float(PyObject* obj) {
    double val;
    if (PyLong_CheckExact(obj)) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (likely(__Pyx_PyLong_IsCompact(obj))) {
            val = (double) __Pyx_PyLong_CompactValue(obj);
            goto no_error;
        }
#endif
        val = PyLong_AsDouble(obj);
    } else if (PyUnicode_CheckExact(obj)) {
        val = __Pyx_PyUnicode_AsDouble(obj);
    } else if (PyBytes_CheckExact(obj)) {
        val = __Pyx_PyBytes_AsDouble(obj);
    } else if (PyByteArray_CheckExact(obj)) {
        val = __Pyx_PyByteArray_AsDouble(obj);
    } else {
        return PyNumber_Float(obj);
    }
    if (unlikely(val == -1 && PyErr_Occurred())) {
        return NULL;
    }
#if CYTHON_USE_PYLONG_INTERNALS
no_error:
#endif
    return PyFloat_FromDouble(val);
}

/* ArgTypeTest */
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    __Pyx_TypeName type_name;
    __Pyx_TypeName obj_type_name;
    PyObject *extra_info = __pyx_mstate_global->__pyx_empty_unicode;
    int from_annotation_subclass = 0;
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (!exact) {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    } else if (exact == 2) {
        if (__Pyx_TypeCheck(obj, type)) {
            from_annotation_subclass = 1;
            extra_info = __pyx_mstate_global->__pyx_kp_u_Note_that_Cython_is_deliberately;
        }
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(type);
    obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
        ", got " __Pyx_FMT_TYPENAME ")"
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        "%s%U"
#endif
        , name, type_name, obj_type_name
#if __PYX_LIMITED_VERSION_HEX < 0x030C0000
        , (from_annotation_subclass ? ". " : ""), extra_info
#endif
        );
#if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    if (exact == 2 && from_annotation_subclass) {
        PyObject *res;
        PyObject *vargs[2];
        vargs[0] = PyErr_GetRaisedException();
        vargs[1] = extra_info;
        res = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_kp_u_add_note, vargs, 2, NULL);
        Py_XDECREF(res);
        PyErr_SetRaisedException(vargs[0]);
    }
#endif
    __Pyx_DECREF_TypeName(type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    PyObject *exc_value = exc_info->exc_value;
    if (exc_value == NULL || exc_value == Py_None) {
        *value = NULL;
        *type = NULL;
        *tb = NULL;
    } else {
        *value = exc_value;
        Py_INCREF(*value);
        *type = (PyObject*) Py_TYPE(exc_value);
        Py_INCREF(*type);
        *tb = PyException_GetTraceback(exc_value);
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
  #endif
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    PyObject *tmp_value = exc_info->exc_value;
    exc_info->exc_value = value;
    Py_XDECREF(tmp_value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
  #else
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
  #endif
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type = NULL, *local_value, *local_tb = NULL;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if PY_VERSION_HEX >= 0x030C0000
    local_value = tstate->current_exception;
    tstate->current_exception = 0;
  #else
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
  #endif
#elif __PYX_LIMITED_VERSION_HEX > 0x030C0000
    local_value = PyErr_GetRaisedException();
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
#if __PYX_LIMITED_VERSION_HEX > 0x030C0000
    if (likely(local_value)) {
        local_type = (PyObject*) Py_TYPE(local_value);
        Py_INCREF(local_type);
        local_tb = PyException_GetTraceback(local_value);
    }
#else
    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 (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
#endif // __PYX_LIMITED_VERSION_HEX > 0x030C0000
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
      #if PY_VERSION_HEX >= 0x030B00a4
        tmp_value = exc_info->exc_value;
        exc_info->exc_value = local_value;
        tmp_type = NULL;
        tmp_tb = NULL;
        Py_XDECREF(local_type);
        Py_XDECREF(local_tb);
      #else
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
      #endif
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#elif __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    PyErr_SetHandledException(local_value);
    Py_XDECREF(local_value);
    Py_XDECREF(local_type);
    Py_XDECREF(local_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
#if __PYX_LIMITED_VERSION_HEX <= 0x030C0000
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
#endif
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* PyObjectVectorCallKwBuilder */
#if CYTHON_VECTORCALL
static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_PyObject_FastCallDict;
    if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
    Py_INCREF(key);
    args[n] = value;
    return 0;
}
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    (void)__Pyx_VectorcallBuilder_AddArgStr;
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
}
static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
    PyObject *pyKey = PyUnicode_FromString(key);
    if (!pyKey) return -1;
    return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
}
#else // CYTHON_VECTORCALL
CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
    if (unlikely(!PyUnicode_Check(key))) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        return -1;
    }
    return PyDict_SetItem(builder, key, value);
}
#endif

/* PyObjectFastCallMethod */
#if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
    PyObject *result;
    PyObject *attr = PyObject_GetAttr(args[0], name);
    if (unlikely(!attr))
        return NULL;
    result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
    Py_DECREF(attr);
    return result;
}
#endif

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

/* SwapException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
  #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_value = exc_info->exc_value;
    exc_info->exc_value = *value;
    if (tmp_value == NULL || tmp_value == Py_None) {
        Py_XDECREF(tmp_value);
        tmp_value = NULL;
        tmp_type = NULL;
        tmp_tb = NULL;
    } else {
        tmp_type = (PyObject*) Py_TYPE(tmp_value);
        Py_INCREF(tmp_type);
        #if CYTHON_COMPILING_IN_CPYTHON
        tmp_tb = ((PyBaseExceptionObject*) tmp_value)->traceback;
        Py_XINCREF(tmp_tb);
        #else
        tmp_tb = PyException_GetTraceback(tmp_value);
        #endif
    }
  #elif CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
  #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
  #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* 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) {
    PyObject* exc_type;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    exc_type = __Pyx_PyErr_CurrentExceptionType();
    if (unlikely(exc_type)) {
        if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
            return -1;
        __Pyx_PyErr_Clear();
        return 0;
    }
    return 0;
}

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

/* CallTypeTraverse */
#if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
#else
static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
    #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
    if (__Pyx_get_runtime_version() < 0x03090000) return 0;
    #endif
    if (!always_call) {
        PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
        unsigned long flags = PyType_GetFlags(base);
        if (flags & Py_TPFLAGS_HEAPTYPE) {
            return 0;
        }
    }
    Py_VISIT((PyObject*)Py_TYPE(o));
    return 0;
}
#endif

/* FixUpExtensionType */
static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
#if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    CYTHON_UNUSED_VAR(spec);
    CYTHON_UNUSED_VAR(type);
#else
    const PyType_Slot *slot = spec->slots;
    while (slot && slot->slot && slot->slot != Py_tp_members)
        slot++;
    if (slot && slot->slot == Py_tp_members) {
        int changed = 0;
#if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
        const
#endif
            PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
        while (memb && memb->name) {
            if (memb->name[0] == '_' && memb->name[1] == '_') {
#if PY_VERSION_HEX < 0x030900b1
                if (strcmp(memb->name, "__weaklistoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_weaklistoffset = memb->offset;
                    changed = 1;
                }
                else if (strcmp(memb->name, "__dictoffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
                    type->tp_dictoffset = memb->offset;
                    changed = 1;
                }
#if CYTHON_METH_FASTCALL
                else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
                    assert(memb->type == T_PYSSIZET);
                    assert(memb->flags == READONLY);
#if PY_VERSION_HEX >= 0x030800b4
                    type->tp_vectorcall_offset = memb->offset;
#else
                    type->tp_print = (printfunc) memb->offset;
#endif
                    changed = 1;
                }
#endif
#else
                if ((0));
#endif
#if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
                else if (strcmp(memb->name, "__module__") == 0) {
                    PyObject *descr;
                    assert(memb->type == T_OBJECT);
                    assert(memb->flags == 0 || memb->flags == READONLY);
                    descr = PyDescr_NewMember(type, memb);
                    if (unlikely(!descr))
                        return -1;
                    if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
                        Py_DECREF(descr);
                        return -1;
                    }
                    Py_DECREF(descr);
                    changed = 1;
                }
#endif
            }
            memb++;
        }
        if (changed)
            PyType_Modified(type);
    }
#endif
    return 0;
}

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg[2] = {NULL, NULL};
    return __Pyx_PyObject_FastCall(func, arg + 1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetFullyQualifiedName(tp);
    PyErr_Format(PyExc_AttributeError,
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* ValidateBasesTuple */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases) {
    Py_ssize_t i, n;
#if CYTHON_ASSUME_SAFE_SIZE
    n = PyTuple_GET_SIZE(bases);
#else
    n = PyTuple_Size(bases);
    if (unlikely(n < 0)) return -1;
#endif
    for (i = 1; i < n; i++)
    {
        PyTypeObject *b;
#if CYTHON_AVOID_BORROWED_REFS
        PyObject *b0 = PySequence_GetItem(bases, i);
        if (!b0) return -1;
#elif CYTHON_ASSUME_SAFE_MACROS
        PyObject *b0 = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *b0 = PyTuple_GetItem(bases, i);
        if (!b0) return -1;
#endif
        b = (PyTypeObject*) b0;
        if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
        {
            __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
            PyErr_Format(PyExc_TypeError,
                "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
            __Pyx_DECREF_TypeName(b_name);
#if CYTHON_AVOID_BORROWED_REFS
            Py_DECREF(b0);
#endif
            return -1;
        }
        if (dictoffset == 0)
        {
            Py_ssize_t b_dictoffset = 0;
#if CYTHON_USE_TYPE_SLOTS
            b_dictoffset = b->tp_dictoffset;
#else
            PyObject *py_b_dictoffset = PyObject_GetAttrString((PyObject*)b, "__dictoffset__");
            if (!py_b_dictoffset) goto dictoffset_return;
            b_dictoffset = PyLong_AsSsize_t(py_b_dictoffset);
            Py_DECREF(py_b_dictoffset);
            if (b_dictoffset == -1 && PyErr_Occurred()) goto dictoffset_return;
#endif
            if (b_dictoffset) {
                {
                    __Pyx_TypeName b_name = __Pyx_PyType_GetFullyQualifiedName(b);
                    PyErr_Format(PyExc_TypeError,
                        "extension type '%.200s' has no __dict__ slot, "
                        "but base type '" __Pyx_FMT_TYPENAME "' has: "
                        "either add 'cdef dict __dict__' to the extension type "
                        "or add '__slots__ = [...]' to the base type",
                        type_name, b_name);
                    __Pyx_DECREF_TypeName(b_name);
                }
#if !CYTHON_USE_TYPE_SLOTS
              dictoffset_return:
#endif
#if CYTHON_AVOID_BORROWED_REFS
                Py_DECREF(b0);
#endif
                return -1;
            }
        }
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(b0);
#endif
    }
    return 0;
}
#endif

/* PyType_Ready */
CYTHON_UNUSED static int __Pyx_PyType_HasMultipleInheritance(PyTypeObject *t) {
    while (t) {
        PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
        if (bases) {
            return 1;
        }
        t = __Pyx_PyType_GetSlot(t, tp_base, PyTypeObject*);
    }
    return 0;
}
static int __Pyx_PyType_Ready(PyTypeObject *t) {
#if CYTHON_USE_TYPE_SPECS || !CYTHON_COMPILING_IN_CPYTHON || defined(PYSTON_MAJOR_VERSION)
    (void)__Pyx_PyObject_CallMethod0;
#if CYTHON_USE_TYPE_SPECS
    (void)__Pyx_validate_bases_tuple;
#endif
    return PyType_Ready(t);
#else
    int r;
    if (!__Pyx_PyType_HasMultipleInheritance(t)) {
        return PyType_Ready(t);
    }
    PyObject *bases = __Pyx_PyType_GetSlot(t, tp_bases, PyObject*);
    if (bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, bases) == -1))
        return -1;
#if !defined(PYSTON_MAJOR_VERSION)
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400) &&\
                !CYTHON_COMPILING_IN_GRAAL
        gc = PyImport_GetModule(__pyx_mstate_global->__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_mstate_global->__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#if PY_VERSION_HEX >= 0x030A0000
        t->tp_flags |= Py_TPFLAGS_IMMUTABLETYPE;
#endif
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if !defined(PYSTON_MAJOR_VERSION)
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_mstate_global->__pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
#endif
}

/* SetVTable */
static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (unlikely(!ob))
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#else
    if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable, ob) < 0))
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_mstate_global->__pyx_n_u_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i=0;
    Py_ssize_t size;
    void** base_vtables;
    __Pyx_TypeName tp_base_name = NULL;
    __Pyx_TypeName base_name = NULL;
    void* unknown = (void*)-1;
    PyObject* bases = __Pyx_PyType_GetSlot(type, tp_bases, PyObject*);
    int base_depth = 0;
    {
        PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        while (base) {
            base_depth += 1;
            base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
        }
    }
    base_vtables = (void**) PyMem_Malloc(sizeof(void*) * (size_t)(base_depth + 1));
    base_vtables[0] = unknown;
#if CYTHON_COMPILING_IN_LIMITED_API
    size = PyTuple_Size(bases);
    if (size < 0) goto other_failure;
#else
    size = PyTuple_GET_SIZE(bases);
#endif
    for (i = 1; i < size; i++) {
        PyObject *basei;
        void* base_vtable;
#if CYTHON_AVOID_BORROWED_REFS
        basei = PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto other_failure;
#else
        basei = PyTuple_GET_ITEM(bases, i);
#endif
        base_vtable = __Pyx_GetVtable((PyTypeObject*)basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = __Pyx_PyType_GetSlot(base, tp_base, PyTypeObject*);
            }
        }
    }
    PyErr_Clear();
    PyMem_Free(base_vtables);
    return 0;
bad:
    {
        PyTypeObject* basei = NULL;
        PyTypeObject* tp_base = __Pyx_PyType_GetSlot(type, tp_base, PyTypeObject*);
        tp_base_name = __Pyx_PyType_GetFullyQualifiedName(tp_base);
#if CYTHON_AVOID_BORROWED_REFS
        basei = (PyTypeObject*)PySequence_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#elif !CYTHON_ASSUME_SAFE_MACROS
        basei = (PyTypeObject*)PyTuple_GetItem(bases, i);
        if (unlikely(!basei)) goto really_bad;
#else
        basei = (PyTypeObject*)PyTuple_GET_ITEM(bases, i);
#endif
        base_name = __Pyx_PyType_GetFullyQualifiedName(basei);
#if CYTHON_AVOID_BORROWED_REFS
        Py_DECREF(basei);
#endif
    }
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
really_bad: // bad has failed!
#endif
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
#if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
other_failure:
#endif
    PyMem_Free(base_vtables);
    return -1;
}

/* LimitedApiGetTypeDict */
#if CYTHON_COMPILING_IN_LIMITED_API
static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
    PyObject *tp_dictoffset_o;
    Py_ssize_t tp_dictoffset;
    tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
    if (unlikely(!tp_dictoffset_o)) return -1;
    tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
    Py_DECREF(tp_dictoffset_o);
    if (unlikely(tp_dictoffset == 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' doesn't have a dictoffset");
        return -1;
    } else if (unlikely(tp_dictoffset < 0)) {
        PyErr_SetString(
            PyExc_TypeError,
            "'type' has an unexpected negative dictoffset. "
            "Please report this as Cython bug");
        return -1;
    }
    return tp_dictoffset;
}
static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
    static Py_ssize_t tp_dictoffset = 0;
    if (unlikely(tp_dictoffset == 0)) {
        tp_dictoffset = __Pyx_GetTypeDictOffset();
        if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
            tp_dictoffset = 0; // try again next time?
            return NULL;
        }
    }
    return *(PyObject**)((char*)tp + tp_dictoffset);
}
#endif

/* DelItemOnTypeDict */
static int __Pyx__DelItemOnTypeDict(PyTypeObject *tp, PyObject *k) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_DelItem(tp_dict, k);
    if (likely(!result)) PyType_Modified(tp);
    return result;
}

/* SetItemOnTypeDict */
static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
    int result;
    PyObject *tp_dict;
#if CYTHON_COMPILING_IN_LIMITED_API
    tp_dict = __Pyx_GetTypeDict(tp);
    if (unlikely(!tp_dict)) return -1;
#else
    tp_dict = tp->tp_dict;
#endif
    result = PyDict_SetItem(tp_dict, k, v);
    if (likely(!result)) {
        PyType_Modified(tp);
        if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name_2))) {
            PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name_2,  (PyObject *) tp, k, NULL);
            if (!setNameResult) return -1;
            Py_DECREF(setNameResult);
        }
    }
    return result;
}

/* SetupReduce */
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_mstate_global->__pyx_n_u_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_getstate = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
    PyObject *getstate = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    getstate = _PyType_Lookup((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
#else
    getstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_getstate);
    if (!getstate && PyErr_Occurred()) {
        goto __PYX_BAD;
    }
#endif
    if (getstate) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_getstate = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
#else
        object_getstate = __Pyx_PyObject_GetAttrStrNoError((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_getstate);
        if (!object_getstate && PyErr_Occurred()) {
            goto __PYX_BAD;
        }
#endif
        if (object_getstate != getstate) {
            goto __PYX_GOOD;
        }
    }
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_mstate_global->__pyx_n_u_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_mstate_global->__pyx_n_u_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_mstate_global->__pyx_n_u_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython);
            if (likely(reduce_cython)) {
                ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_mstate_global->__pyx_n_u_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = __Pyx_SetItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = __Pyx_DelItemOnTypeDict((PyTypeObject*)type_obj, __pyx_mstate_global->__pyx_n_u_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetFullyQualifiedName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
    Py_XDECREF(object_getstate);
    Py_XDECREF(getstate);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    if (level == -1) {
        const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
        if (package_sep != (0)) {
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, 1);
            if (unlikely(!module)) {
                if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                    goto bad;
                PyErr_Clear();
            }
        }
        level = 0;
    }
    if (!module) {
        module = PyImport_ImportModuleLevelObject(
            name, __pyx_mstate_global->__pyx_d, empty_dict, from_list, level);
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    return module;
}

/* ImportDottedModule */
static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
    PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
    Py_ssize_t size;
    if (unlikely(PyErr_Occurred())) {
        PyErr_Clear();
    }
#if CYTHON_ASSUME_SAFE_SIZE
    size = PyTuple_GET_SIZE(parts_tuple);
#else
    size = PyTuple_Size(parts_tuple);
    if (size < 0) goto bad;
#endif
    if (likely(size == count)) {
        partial_name = name;
    } else {
        slice = PySequence_GetSlice(parts_tuple, 0, count);
        if (unlikely(!slice))
            goto bad;
        sep = PyUnicode_FromStringAndSize(".", 1);
        if (unlikely(!sep))
            goto bad;
        partial_name = PyUnicode_Join(sep, slice);
    }
    PyErr_Format(
        PyExc_ModuleNotFoundError,
        "No module named '%U'", partial_name);
bad:
    Py_XDECREF(sep);
    Py_XDECREF(slice);
    Py_XDECREF(partial_name);
    return NULL;
}
static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
    PyObject *imported_module;
#if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
        CYTHON_COMPILING_IN_GRAAL
    PyObject *modules = PyImport_GetModuleDict();
    if (unlikely(!modules))
        return NULL;
    imported_module = __Pyx_PyDict_GetItemStr(modules, name);
    Py_XINCREF(imported_module);
#else
    imported_module = PyImport_GetModule(name);
#endif
    return imported_module;
}
static PyObject *__Pyx_ImportDottedModule_WalkParts(PyObject *module, PyObject *name, PyObject *parts_tuple) {
    Py_ssize_t i, nparts;
#if CYTHON_ASSUME_SAFE_SIZE
    nparts = PyTuple_GET_SIZE(parts_tuple);
#else
    nparts = PyTuple_Size(parts_tuple);
    if (nparts < 0) return NULL;
#endif
    for (i=1; i < nparts && module; i++) {
        PyObject *part, *submodule;
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        part = PyTuple_GET_ITEM(parts_tuple, i);
#else
        part = __Pyx_PySequence_ITEM(parts_tuple, i);
        if (!part) return NULL;
#endif
        submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
#if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
        Py_DECREF(part);
#endif
        Py_DECREF(module);
        module = submodule;
    }
    if (unlikely(!module)) {
        return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
    }
    return module;
}
static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
    PyObject *imported_module;
    PyObject *module = __Pyx_Import(name, NULL, 0);
    if (!parts_tuple || unlikely(!module))
        return module;
    imported_module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(imported_module)) {
        Py_DECREF(module);
        return imported_module;
    }
    PyErr_Clear();
    return __Pyx_ImportDottedModule_WalkParts(module, name, parts_tuple);
}
static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
    if (likely(module)) {
        PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_mstate_global->__pyx_n_u_spec);
        if (likely(spec)) {
            PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_mstate_global->__pyx_n_u_initializing);
            if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
                Py_DECREF(spec);
                spec = NULL;
            }
            Py_XDECREF(unsafe);
        }
        if (likely(!spec)) {
            PyErr_Clear();
            return module;
        }
        Py_DECREF(spec);
        Py_DECREF(module);
    } else if (PyErr_Occurred()) {
        PyErr_Clear();
    }
#endif
    return __Pyx__ImportDottedModule(name, parts_tuple);
}

/* ListPack */
static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) {
    va_list va;
    PyObject *l = PyList_New(n);
    va_start(va, n);
    if (unlikely(!l)) goto end;
    for (Py_ssize_t i=0; i<n; ++i) {
        PyObject *arg = va_arg(va, PyObject*);
        Py_INCREF(arg);
        if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) {
            Py_CLEAR(l);
            goto end;
        }
    }
    end:
    va_end(va);
    return l;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        const char* module_name_str = 0;
        PyObject* module_name = 0;
        PyObject* module_dot = 0;
        PyObject* full_name = 0;
        PyErr_Clear();
        module_name_str = PyModule_GetName(module);
        if (unlikely(!module_name_str)) { goto modbad; }
        module_name = PyUnicode_FromString(module_name_str);
        if (unlikely(!module_name)) { goto modbad; }
        module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u__40);
        if (unlikely(!module_dot)) { goto modbad; }
        full_name = PyUnicode_Concat(module_dot, name);
        if (unlikely(!full_name)) { goto modbad; }
        #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM  < 0x07030400) ||\
                CYTHON_COMPILING_IN_GRAAL
        {
            PyObject *modules = PyImport_GetModuleDict();
            if (unlikely(!modules))
                goto modbad;
            value = PyObject_GetItem(modules, full_name);
        }
        #else
        value = PyImport_GetModule(full_name);
        #endif
      modbad:
        Py_XDECREF(full_name);
        Py_XDECREF(module_dot);
        Py_XDECREF(module_name);
    }
    if (unlikely(!value)) {
        PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
    }
    return value;
}

/* Py3UpdateBases */
static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
#if CYTHON_ASSUME_SAFE_SIZE
    size_bases = PyTuple_GET_SIZE(bases);
#else
    size_bases = PyTuple_Size(bases);
    if (size_bases < 0) return NULL;
#endif
    for (i = 0; i < size_bases; i++) {
#if CYTHON_AVOID_BORROWED_REFS
        Py_CLEAR(base);
#endif
#if CYTHON_ASSUME_SAFE_MACROS
        base = PyTuple_GET_ITEM(bases, i);
#else
        base = PyTuple_GetItem(bases, i);
        if (!base) goto error;
#endif
#if CYTHON_AVOID_BORROWED_REFS
        Py_INCREF(base);
#endif
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                PyObject *base_from_list;
#if CYTHON_ASSUME_SAFE_MACROS
                base_from_list = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base_from_list);
                Py_INCREF(base_from_list);
#else
                base_from_list = PyTuple_GetItem(bases, j);
                if (!base_from_list) goto error;
                Py_INCREF(base_from_list);
                if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
#endif
            }
        }
#if CYTHON_ASSUME_SAFE_SIZE
        j = PyList_GET_SIZE(new_bases);
#else
        j = PyList_Size(new_bases);
        if (j < 0) goto error;
#endif
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return result;
error:
    Py_XDECREF(new_bases);
#if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(base);
#endif
    return NULL;
}

/* CalculateMetaclass */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases;
#if CYTHON_ASSUME_SAFE_SIZE
    nbases = PyTuple_GET_SIZE(bases);
#else
    nbases = PyTuple_Size(bases);
    if (nbases < 0) return NULL;
#endif
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
#if CYTHON_ASSUME_SAFE_MACROS
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
#else
        PyObject *tmp = PyTuple_GetItem(bases, i);
        if (!tmp) return NULL;
#endif
        tmptype = Py_TYPE(tmp);
        if (!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) {
        metaclass = &PyType_Type;
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* PyObjectCall2Args */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectLookupSpecial */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* Py3ClassCreate */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_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;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
    Py_XDECREF(owned_metaclass);
    return result;
}

/* FetchSharedCythonModule */
static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
}

/* dict_setdefault */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value,
                                                       int is_safe_type) {
    PyObject* value;
    CYTHON_MAYBE_UNUSED_VAR(is_safe_type);
#if CYTHON_COMPILING_IN_LIMITED_API
    value = PyObject_CallMethod(d, "setdefault", "OO", key, default_value);
#elif PY_VERSION_HEX >= 0x030d0000
    PyDict_SetDefaultRef(d, key, default_value, &value);
#else
    value = PyDict_SetDefault(d, key, default_value);
    if (unlikely(!value)) return NULL;
    Py_INCREF(value);
#endif
    return value;
}

/* FetchCommonType */
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t expected_basicsize) {
    Py_ssize_t basicsize;
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_basicsize;
    py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
    if (unlikely(!py_basicsize)) return -1;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = NULL;
    if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
#else
    basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
#endif
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
    int get_item_ref_result;
    const char* object_name = strrchr(spec->name, '.');
    object_name = object_name ? object_name+1 : spec->name;
    py_object_name = PyUnicode_FromString(object_name);
    if (!py_object_name) return NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) goto done;
    abi_module_dict = PyModule_GetDict(abi_module);
    if (!abi_module_dict) goto done;
    get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
    if (get_item_ref_result == 1) {
        if (__Pyx_VerifyCachedType(
              cached_type,
              object_name,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else if (unlikely(get_item_ref_result == -1)) {
        goto bad;
    }
    CYTHON_UNUSED_VAR(module);
    cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
    new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type, 1);
    if (unlikely(new_cached_type != cached_type)) {
        if (unlikely(!new_cached_type)) goto bad;
        Py_DECREF(cached_type);
        cached_type = new_cached_type;
        if (__Pyx_VerifyCachedType(
                cached_type,
                object_name,
                spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    } else {
        Py_DECREF(new_cached_type);
    }
done:
    Py_XDECREF(abi_module);
    Py_DECREF(py_object_name);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* PyMethodNew */
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    PyObject *result;
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
    {
        PyObject *args[] = {func, self};
        result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
    }
    #else
    result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
    #endif
    return result;
}
#else
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#endif

/* PyVectorcallFastCallDict */
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    #if !CYTHON_ASSUME_SAFE_SIZE
    Py_ssize_t nkw = PyDict_Size(kw);
    if (unlikely(nkw == -1)) return NULL;
    #else
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    #endif
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &=
        #if CYTHON_COMPILING_IN_LIMITED_API
            PyType_GetFlags(Py_TYPE(key));
        #else
            Py_TYPE(key)->tp_flags;
        #endif
        Py_INCREF(key);
        Py_INCREF(value);
        #if !CYTHON_ASSUME_SAFE_MACROS
        if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
        #else
        PyTuple_SET_ITEM(kwnames, i, key);
        #endif
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    Py_ssize_t kw_size =
        likely(kw == NULL) ?
        0 :
#if !CYTHON_ASSUME_SAFE_SIZE
        PyDict_Size(kw);
#else
        PyDict_GET_SIZE(kw);
#endif
    if (kw_size == 0) {
        return vc(func, args, nargs, NULL);
    }
#if !CYTHON_ASSUME_SAFE_SIZE
    else if (unlikely(kw_size == -1)) {
        return NULL;
    }
#endif
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
    if (__Pyx_CyFunction_Check(func)) {
        return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
    } else if (PyCFunction_Check(func)) {
        return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
        int result;
        PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
        if (unlikely(!newFunc)) {
            PyErr_Clear(); // It's only an optimization, so don't throw an error
            return 0;
        }
        result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
        Py_DECREF(newFunc);
        return result;
    }
    return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
}
#else
static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
    if (PyMethod_Check(func)) {
        func = PyMethod_GET_FUNCTION(func);
    }
    return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
}
#endif
static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    __Pyx_Py_XDECREF_SET(
        __Pyx_CyFunction_GetClassObj(f),
            ((classobj) ? __Pyx_NewRef(classobj) : NULL));
#else
    __Pyx_Py_XDECREF_SET(
        ((PyCMethodObject *) (f))->mm_class,
        (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
#endif
}
static PyObject *
__Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_doc == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
        if (unlikely(!op->func_doc)) return NULL;
#else
        if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
            op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
#endif
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
    PyObject *result;
    CYTHON_UNUSED_VAR(closure);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_doc_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if CYTHON_COMPILING_IN_LIMITED_API
        op->func_name = PyObject_GetAttrString(op->func, "__name__");
#else
        op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_name_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    Py_INCREF(op->func_qualname);
    result = op->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict_locked(__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 PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    PyObject *result;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_dict_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = NULL;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_defaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
                 "currently affect the values used in function calls", 1);
    Py_INCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_kwdefaults_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    __Pyx_END_CRITICAL_SECTION();
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations_locked(__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 PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    result = __Pyx_CyFunction_get_annotations_locked(op);
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
    int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
    if (is_coroutine) {
        PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
#if CYTHON_ASSUME_SAFE_MACROS
        PyList_SET_ITEM(fromlist, 0, marker);
#else
        if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
            Py_DECREF(marker);
            Py_DECREF(fromlist);
            return NULL;
        }
#endif
        module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(is_coroutine_value)) {
            return is_coroutine_value;
        }
ignore:
        PyErr_Clear();
    }
    return __Pyx_PyBool_FromLong(is_coroutine);
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    PyObject *result;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    result = __Pyx_CyFunction_get_is_coroutine_value(op);
    if (unlikely(!result))
        return NULL;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    if (op->func_is_coroutine) {
        Py_DECREF(result);
        result = __Pyx_NewRef(op->func_is_coroutine);
    } else {
        op->func_is_coroutine = __Pyx_NewRef(result);
    }
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        py_name, message, size);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
        name, message, size);
#endif
}
static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
    if (!py_name) return;
    PyErr_Format(PyExc_TypeError,
        "%.200S() %s",
        py_name, message);
    Py_DECREF(py_name);
#else
    const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
    PyErr_Format(PyExc_TypeError,
        "%.200s() %s",
        name, message);
#endif
}
static  PyObject* __pyx_CyFunction_getattro(__pyx_CyFunctionObject *self, PyObject *attr) {
    if (unlikely(PyUnicode_CompareWithASCIIString(attr, "__module__") == 0)) {
        #if CYTHON_COMPILING_IN_LIMITED_API
        return PyObject_GetAttr(self->func, attr);
        #else
        PyObject *module;
        __Pyx_BEGIN_CRITICAL_SECTION(self);
        module = __Pyx_XNewRef(((PyCFunctionObject*)self)->m_module);
        __Pyx_END_CRITICAL_SECTION();
        return module ? module : __Pyx_NewRef(Py_None);
        #endif
    }
    return PyObject_GenericGetAttr((PyObject*)self, attr);
}
static int __pyx_CyFunction_setattro(__pyx_CyFunctionObject *self, PyObject *attr, PyObject *value) {
    if (unlikely(PyUnicode_CompareWithASCIIString(attr, "__module__") == 0)) {
        #if CYTHON_COMPILING_IN_LIMITED_API
        return PyObject_SetAttr(self->func, attr, value);
        #else
        __Pyx_BEGIN_CRITICAL_SECTION(self);
        Py_XINCREF(value);
        Py_XSETREF(((PyCFunctionObject*)self)->m_module, value);
        __Pyx_END_CRITICAL_SECTION();
        return 0;
        #endif
    }
    return PyObject_GenericSetAttr((PyObject*)self, attr, value);
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if CYTHON_METH_FASTCALL
#if CYTHON_BACKPORT_VECTORCALL || CYTHON_COMPILING_IN_LIMITED_API
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
#else
    {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
    {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    PyObject *result = NULL;
    CYTHON_UNUSED_VAR(args);
    __Pyx_BEGIN_CRITICAL_SECTION(m);
    Py_INCREF(m->func_qualname);
    result = m->func_qualname;
    __Pyx_END_CRITICAL_SECTION();
    return result;
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
#if !CYTHON_COMPILING_IN_LIMITED_API
    PyCFunctionObject *cf = (PyCFunctionObject*) op;
#endif
    if (unlikely(op == NULL))
        return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
    if (unlikely(!op->func)) return NULL;
#endif
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
#if !CYTHON_COMPILING_IN_LIMITED_API
    cf->m_ml = ml;
    cf->m_self = (PyObject *) op;
#endif
    Py_XINCREF(closure);
    op->func_closure = closure;
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_XINCREF(module);
    cf->m_module = module;
#endif
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
#if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
    op->func_classobj = NULL;
#else
    ((PyCMethodObject*)op)->mm_class = NULL;
#endif
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(m->func);
#else
    Py_CLEAR(((PyCFunctionObject*)m)->m_module);
#endif
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
#if PY_VERSION_HEX < 0x030900B1
    Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
#else
    {
        PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
        ((PyCMethodObject *) (m))->mm_class = NULL;
        Py_XDECREF(cls);
    }
#endif
#endif
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    Py_CLEAR(m->defaults);
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    __Pyx_PyHeapTypeObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    {
        int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
        if (e) return e;
    }
    Py_VISIT(m->func_closure);
#if CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(m->func);
#else
    Py_VISIT(((PyCFunctionObject*)m)->m_module);
#endif
    Py_VISIT(m->func_dict);
    __Pyx_VISIT_CONST(m->func_name);
    __Pyx_VISIT_CONST(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    __Pyx_VISIT_CONST(m->func_code);
#if !CYTHON_COMPILING_IN_LIMITED_API
    Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
#endif
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    Py_VISIT(m->defaults);
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
    PyObject *repr;
    __Pyx_BEGIN_CRITICAL_SECTION(op);
    repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
    __Pyx_END_CRITICAL_SECTION();
    return repr;
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
    PyCFunction meth;
    int flags;
    meth = PyCFunction_GetFunction(f);
    if (unlikely(!meth)) return NULL;
    flags = PyCFunction_GetFlags(f);
    if (unlikely(flags < 0)) return NULL;
#else
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    int flags = f->m_ml->ml_flags;
#endif
    Py_ssize_t size;
    switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 0))
                return (*meth)(self, NULL);
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes no arguments", size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
#if CYTHON_ASSUME_SAFE_SIZE
            size = PyTuple_GET_SIZE(arg);
#else
            size = PyTuple_Size(arg);
            if (unlikely(size < 0)) return NULL;
#endif
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            __Pyx_CyFunction_raise_argument_count_error(
                (__pyx_CyFunctionObject*)func,
                "takes exactly one argument", size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    __Pyx_CyFunction_raise_type_error(
        (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *self, *result;
#if CYTHON_COMPILING_IN_LIMITED_API
    self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
    if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
    self = ((PyCFunctionObject*)func)->m_self;
#endif
    result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
    return result;
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
#if CYTHON_ASSUME_SAFE_SIZE
        argc = PyTuple_GET_SIZE(args);
#else
        argc = PyTuple_Size(args);
        if (unlikely(argc < 0)) return NULL;
#endif
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            PyErr_Format(PyExc_TypeError,
                         "unbound method %.200S() needs an argument",
                         cyfunc->func_qualname);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL && (CYTHON_VECTORCALL || CYTHON_BACKPORT_VECTORCALL)
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            __Pyx_CyFunction_raise_type_error(
                cyfunc, "needs an argument");
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
        __Pyx_CyFunction_raise_type_error(
            cyfunc, "takes no keyword arguments");
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes no arguments", nargs);
        return NULL;
    }
    return meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        __Pyx_CyFunction_raise_argument_count_error(
            cyfunc, "takes exactly one argument", nargs);
        return NULL;
    }
    return meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
    if (unlikely(!meth)) return NULL;
#else
    PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
#endif
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
#if CYTHON_COMPILING_IN_LIMITED_API
        self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
        if (unlikely(!self) && PyErr_Occurred()) return NULL;
#else
        self = ((PyCFunctionObject*)cyfunc)->m_self;
#endif
        break;
    default:
        return NULL;
    }
    return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, (size_t)nargs, kwnames);
}
#endif
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_getattro, (void *)__pyx_CyFunction_getattro},
    {Py_tp_setattro, (void *)__pyx_CyFunction_setattro},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#if CYTHON_METH_FASTCALL
#if defined(Py_TPFLAGS_HAVE_VECTORCALL)
    Py_TPFLAGS_HAVE_VECTORCALL |
#elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
#endif // CYTHON_METH_FASTCALL
#if PY_VERSION_HEX >= 0x030A0000
    Py_TPFLAGS_IMMUTABLETYPE |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
    __pyx_CyFunctionType_slots
};
static int __pyx_CyFunction_init(PyObject *module) {
    __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
    mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
    if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
    if (unlikely(!m->defaults))
        return NULL;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* ClassMethod */
static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM <= 0x05080000
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
#if CYTHON_COMPILING_IN_PYPY
    if (PyMethodDescr_Check(method))
#else
    if (__Pyx_TypeCheck(method, &PyMethodDescr_Type))
#endif
    {
#if CYTHON_COMPILING_IN_LIMITED_API
        return PyErr_Format(
            PyExc_SystemError,
            "Cython cannot yet handle classmethod on a MethodDescriptorType (%S) in limited API mode. "
            "This is most likely a classmethod in a cdef class method with binding=False. "
            "Try setting 'binding' to True.",
            method);
#elif CYTHON_COMPILING_IN_GRAAL
        PyTypeObject *d_type = PyDescrObject_GetType(method);
        return PyDescr_NewClassMethod(d_type, PyMethodDescrObject_GetMethod(method));
#else
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        PyTypeObject *d_type = descr->d_common.d_type;
        return PyDescr_NewClassMethod(d_type, descr->d_method);
#endif
    }
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else {
        return PyClassMethod_New(method);
    }
#else
    {
        PyObject *func=NULL;
        PyObject *builtins, *classmethod, *classmethod_str, *result=NULL;
        if (__Pyx_TypeCheck(method, __pyx_mstate_global->__Pyx_CachedMethodType)) {
            func = PyObject_GetAttrString(method, "__func__");
            if (!func) goto bad;
        } else {
            func = method;
            Py_INCREF(func);
        }
        builtins = PyEval_GetBuiltins(); // borrowed
        if (unlikely(!builtins)) goto bad;
        classmethod_str = PyUnicode_FromString("classmethod");
        if (unlikely(!classmethod_str)) goto bad;
        classmethod = PyObject_GetItem(builtins, classmethod_str);
        Py_DECREF(classmethod_str);
        if (unlikely(!classmethod)) goto bad;
        result = PyObject_CallFunctionObjArgs(classmethod, func, NULL);
        Py_DECREF(classmethod);
        bad:
        Py_XDECREF(func);
        return result;
    }
#endif
}

/* GetNameInClass */
static PyObject *__Pyx__GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    PyObject *dict;
    assert(PyType_Check(nmspace));
#if CYTHON_USE_TYPE_SLOTS
    dict = ((PyTypeObject*)nmspace)->tp_dict;
    Py_XINCREF(dict);
#else
    dict = PyObject_GetAttr(nmspace, __pyx_mstate_global->__pyx_n_u_dict);
#endif
    if (likely(dict)) {
        result = PyObject_GetItem(dict, name);
        Py_DECREF(dict);
        if (result) {
            return result;
        }
    }
    PyErr_Clear();
    __Pyx_GetModuleGlobalNameUncached(result, name);
    return result;
}

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

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else {
      Py_ssize_t size = __Pyx_PyTuple_GET_SIZE(t);
 #if !CYTHON_ASSUME_SAFE_SIZE
      if (unlikely(size < 0)) return;
 #endif
      if (size < index) {
        __Pyx_RaiseNeedMoreValuesError(size);
      } else {
        __Pyx_RaiseTooManyValuesError(index);
      }
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2(
        PyObject* tuple, PyObject** value1, PyObject** value2, int is_tuple, int has_known_size, int decref_tuple) {
    if (likely(is_tuple || PyTuple_Check(tuple))) {
        Py_ssize_t size;
        if (has_known_size) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        size = __Pyx_PyTuple_GET_SIZE(tuple);
        if (likely(size == 2)) {
            return __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple);
        }
        if (size >= 0) {
            __Pyx_UnpackTupleError(tuple, 2);
        }
        return -1;
    } else {
        return __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple);
    }
}
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
    value1 = __Pyx_PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = __Pyx_PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_AVOID_BORROWED_REFS || !CYTHON_ASSUME_SAFE_MACROS
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
#if CYTHON_COMPILING_IN_PYPY
#include <string.h>
#endif
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#else
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
#if !CYTHON_COMPILING_IN_PYPY
static CYTHON_INLINE int __Pyx_dict_iter_next_source_is_dict(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem) {
    PyObject *key, *value;
    if (unlikely(orig_length != PyDict_Size(iter_obj))) {
        PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
        return -1;
    }
    if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
        return 0;
    }
    if (pitem) {
        PyObject* tuple = PyTuple_New(2);
        if (unlikely(!tuple)) {
            return -1;
        }
        Py_INCREF(key);
        Py_INCREF(value);
        #if CYTHON_ASSUME_SAFE_MACROS
        PyTuple_SET_ITEM(tuple, 0, key);
        PyTuple_SET_ITEM(tuple, 1, value);
        #else
        if (unlikely(PyTuple_SetItem(tuple, 0, key) < 0)) {
            Py_DECREF(value);
            Py_DECREF(tuple);
            return -1;
        }
        if (unlikely(PyTuple_SetItem(tuple, 1, value) < 0)) {
            Py_DECREF(tuple);
            return -1;
        }
        #endif
        *pitem = tuple;
    } else {
        if (pkey) {
            Py_INCREF(key);
            *pkey = key;
        }
        if (pvalue) {
            Py_INCREF(value);
            *pvalue = value;
        }
    }
    return 1;
}
#endif
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        int result;
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_BEGIN_CRITICAL_SECTION(iter_obj);
#endif
        result = __Pyx_dict_iter_next_source_is_dict(iter_obj, orig_length, ppos, pkey, pvalue, pitem);
#if PY_VERSION_HEX >= 0x030d0000 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_END_CRITICAL_SECTION();
#endif
        return result;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t tuple_size = __Pyx_PyTuple_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(tuple_size < 0)) return -1;
        #endif
        if (unlikely(pos >= tuple_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_ASSUME_SAFE_MACROS
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        #else
        next_item = PyTuple_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #endif
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        Py_ssize_t list_size = __Pyx_PyList_GET_SIZE(iter_obj);
        #if !CYTHON_ASSUME_SAFE_SIZE
        if (unlikely(list_size < 0)) return -1;
        #endif
        if (unlikely(pos >= list_size)) return 0;
        *ppos = pos + 1;
        #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
        next_item = PyList_GetItemRef(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        #elif CYTHON_ASSUME_SAFE_MACROS
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
        #else
        next_item = PyList_GetItem(iter_obj, pos);
        if (unlikely(!next_item)) return -1;
        Py_INCREF(next_item);
        #endif
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyUnicode_Check(n)))
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* Globals */
static PyObject* __Pyx_Globals(void) {
    return __Pyx_NewRef(__pyx_mstate_global->__pyx_d);
}

/* CLineInTraceback */
#if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    CYTHON_MAYBE_UNUSED_VAR(tstate);
    if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_mstate_global->__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __Pyx_BEGIN_CRITICAL_SECTION(*cython_runtime_dict);
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback))
        Py_XINCREF(use_cline);
        __Pyx_END_CRITICAL_SECTION();
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_INCREF(use_cline);
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_mstate_global->__pyx_cython_runtime, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    Py_XDECREF(use_cline);
    __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 __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
    __Pyx_CachedCodeObjectType* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
    if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = code_cache->entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__find_code_object;
    return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
    if (old_count < 0) {
        __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
        return NULL;
    }
#endif
    __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
#endif
    return result;
#endif
}
static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
{
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            code_cache->entries = entries;
            code_cache->max_count = 64;
            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(code_cache->entries, code_cache->count, code_line);
    if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
        __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_INCREF(code_object);
        Py_DECREF(tmp);
        return;
    }
    if (code_cache->count == code_cache->max_count) {
        int new_max = code_cache->max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        code_cache->entries = entries;
        code_cache->max_count = new_max;
    }
    for (i=code_cache->count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    code_cache->count++;
    Py_INCREF(code_object);
}
static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
    (void)__pyx__insert_code_object;
    return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
#else
    struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_nonatomic_int_type expected = 0;
    if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
        return;
    }
#endif
    __pyx__insert_code_object(code_cache, code_line, code_object);
#if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
    __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
#endif
#endif
}

/* AddTraceback */
#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  #ifndef Py_BUILD_CORE
    #define Py_BUILD_CORE 1
  #endif
  #include "internal/pycore_frame.h"
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
                                                       PyObject *firstlineno, PyObject *name) {
    PyObject *replace = NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
    if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
    replace = PyObject_GetAttrString(code, "replace");
    if (likely(replace)) {
        PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
        Py_DECREF(replace);
        return result;
    }
    PyErr_Clear();
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
    PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
    PyObject *exc_type, *exc_value, *exc_traceback;
    int success = 0;
    if (c_line) {
        (void) __pyx_cfilenm;
        (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
    code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!code_object) {
        code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
        if (unlikely(!code_object)) goto bad;
        py_py_line = PyLong_FromLong(py_line);
        if (unlikely(!py_py_line)) goto bad;
        py_funcname = PyUnicode_FromString(funcname);
        if (unlikely(!py_funcname)) goto bad;
        dict = PyDict_New();
        if (unlikely(!dict)) goto bad;
        {
            PyObject *old_code_object = code_object;
            code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
            Py_DECREF(old_code_object);
        }
        if (unlikely(!code_object)) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
    } else {
        dict = PyDict_New();
    }
    getframe = PySys_GetObject("_getframe");
    if (unlikely(!getframe)) goto bad;
    if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
    frame = PyEval_EvalCode(code_object, dict, dict);
    if (unlikely(!frame) || frame == Py_None) goto bad;
    success = 1;
  bad:
    PyErr_Restore(exc_type, exc_value, exc_traceback);
    Py_XDECREF(code_object);
    Py_XDECREF(py_py_line);
    Py_XDECREF(py_funcname);
    Py_XDECREF(dict);
    Py_XDECREF(replace);
    if (success) {
        PyTraceBack_Here(
            (struct _frame*)frame);
    }
    Py_XDECREF(frame);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = NULL;
    PyObject *py_funcname = NULL;
    if (c_line) {
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        if (!py_funcname) goto bad;
        funcname = PyUnicode_AsUTF8(py_funcname);
        if (!funcname) goto bad;
    }
    py_code = PyCode_NewEmpty(filename, funcname, py_line);
    Py_XDECREF(py_funcname);
    return py_code;
bad:
    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;
    PyObject *ptype, *pvalue, *ptraceback;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) {
            /* If the code object creation fails, then we should clear the
               fetched exception references and propagate the new exception */
            Py_XDECREF(ptype);
            Py_XDECREF(pvalue);
            Py_XDECREF(ptraceback);
            goto bad;
        }
        __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_mstate_global->__pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
static CYTHON_INLINE size_t __Pyx_PyLong_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyLong_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (size_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(size_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(size_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(size_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        size_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (size_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (size_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (size_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (size_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(size_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((size_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(size_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((size_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((size_t) 1) << (sizeof(size_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (size_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int64_t __Pyx_PyLong_As_int64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int64_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int64_t) -1;
        val = __Pyx_PyLong_As_int64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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
        }
    }
    {
        int64_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int64_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int64_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int64_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int64_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int64_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int64_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int64_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int64_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int64_t) 1) << (sizeof(int64_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int64_t) -1;
        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;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int64_t(int64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int64_t neg_one = (int64_t) -1, const_zero = (int64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int64_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int64_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE int32_t __Pyx_PyLong_As_int32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int32_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int32_t) -1;
        val = __Pyx_PyLong_As_int32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int32_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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
        }
    }
    {
        int32_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int32_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int32_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int32_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int32_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int32_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int32_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int32_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int32_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int32_t) 1) << (sizeof(int32_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int32_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int32_t");
    return (int32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int32_t");
    return (int32_t) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint64_t(uint64_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint64_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint64_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint64_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint64_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint64_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_uint8_t(uint8_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(uint8_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(uint8_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } else if (sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(uint8_t) <= sizeof(long)) {
            return PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(uint8_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(uint8_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(uint8_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE uint64_t __Pyx_PyLong_As_uint64_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint64_t neg_one = (uint64_t) -1, const_zero = (uint64_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        uint64_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (uint64_t) -1;
        val = __Pyx_PyLong_As_uint64_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(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 && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (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
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint64_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(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
        }
    }
    {
        uint64_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (uint64_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (uint64_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (uint64_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (uint64_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(uint64_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((uint64_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(uint64_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((uint64_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((uint64_t) 1) << (sizeof(uint64_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (uint64_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint64_t");
    return (uint64_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint64_t");
    return (uint64_t) -1;
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_int32_t(int32_t value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int32_t neg_one = (int32_t) -1, const_zero = (int32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int32_t) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(int32_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int32_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(int32_t),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(int32_t));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntToPy */
static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyLong_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#if defined(HAVE_LONG_LONG) && !CYTHON_COMPILING_IN_PYPY
        } 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 PyLong_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        unsigned char *bytes = (unsigned char *)&value;
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
        if (is_unsigned) {
            return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
        } else {
            return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
        }
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
        int one = 1; int little = (int)*(unsigned char *)&one;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
#else
        int one = 1; int little = (int)*(unsigned char *)&one;
        PyObject *from_bytes, *result = NULL, *kwds = NULL;
        PyObject *py_bytes = NULL, *order_str = NULL;
        from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
        if (!from_bytes) return NULL;
        py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
        if (!py_bytes) goto limited_bad;
        order_str = PyUnicode_FromString(little ? "little" : "big");
        if (!order_str) goto limited_bad;
        {
            PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
            if (!is_unsigned) {
                kwds = __Pyx_MakeVectorcallBuilderKwds(1);
                if (!kwds) goto limited_bad;
                if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
            }
            result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
        }
        limited_bad:
        Py_XDECREF(kwds);
        Py_XDECREF(order_str);
        Py_XDECREF(py_bytes);
        Py_XDECREF(from_bytes);
        return result;
#endif
    }
}

/* CIntFromPy */
static CYTHON_INLINE uint8_t __Pyx_PyLong_As_uint8_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint8_t neg_one = (uint8_t) -1, const_zero = (uint8_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        uint8_t val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (uint8_t) -1;
        val = __Pyx_PyLong_As_uint8_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) >= 2 * PyLong_SHIFT)) {
                            return (uint8_t) (((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) >= 3 * PyLong_SHIFT)) {
                            return (uint8_t) (((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) >= 4 * PyLong_SHIFT)) {
                            return (uint8_t) (((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (uint8_t) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(uint8_t) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(uint8_t) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint8_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(uint8_t, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(uint8_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint8_t) (((uint8_t)-1)*(((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(uint8_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint8_t) ((((((uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(uint8_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint8_t) (((uint8_t)-1)*(((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint8_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint8_t) ((((((((uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(uint8_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint8_t) (((uint8_t)-1)*(((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint8_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint8_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint8_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint8_t) ((((((((((uint8_t)digits[3]) << PyLong_SHIFT) | (uint8_t)digits[2]) << PyLong_SHIFT) | (uint8_t)digits[1]) << PyLong_SHIFT) | (uint8_t)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(uint8_t) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint8_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(uint8_t) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(uint8_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        uint8_t val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (uint8_t) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (uint8_t) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (uint8_t) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (uint8_t) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(uint8_t) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((uint8_t) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(uint8_t) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((uint8_t) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((uint8_t) 1) << (sizeof(uint8_t) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (uint8_t) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint8_t");
    return (uint8_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint8_t");
    return (uint8_t) -1;
}

/* FormatTypeName */
#if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
static __Pyx_TypeName
__Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
{
    PyObject *module = NULL, *name = NULL, *result = NULL;
    #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
    name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_qualname);
    #else
    name = PyType_GetQualName(tp);
    #endif
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
    module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_mstate_global->__pyx_n_u_module);
    if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
    if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
        result = name;
        name = NULL;
        goto done;
    }
    result = PyUnicode_FromFormat("%U.%U", module, name);
    if (unlikely(result == NULL)) goto bad;
  done:
    Py_XDECREF(name);
    Py_XDECREF(module);
    return result;
  bad:
    PyErr_Clear();
    if (name) {
        result = name;
        name = NULL;
    } else {
        result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__41);
    }
    goto done;
}
#endif

/* CIntFromPy */
static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyLong_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (long) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(long) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(long) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        long val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (long) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (long) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (long) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (long) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((long) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((long) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (long) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (unlikely(!PyLong_Check(x))) {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Long(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyLong_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
    if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
        if (unlikely(__Pyx_PyLong_IsNeg(x))) {
            goto raise_neg_overflow;
        } else if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_DigitCount(x)) {
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
        }
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
        if (unlikely(Py_SIZE(x) < 0)) {
            goto raise_neg_overflow;
        }
#else
        {
            int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
            if (unlikely(result < 0))
                return (int) -1;
            if (unlikely(result == 1))
                goto raise_neg_overflow;
        }
#endif
        if ((sizeof(int) <= sizeof(unsigned long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
        }
    } else {
#if CYTHON_USE_PYLONG_INTERNALS
        if (__Pyx_PyLong_IsCompact(x)) {
            __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
        } else {
            const digit* digits = __Pyx_PyLong_Digits(x);
            assert(__Pyx_PyLong_DigitCount(x) > 1);
            switch (__Pyx_PyLong_SignedDigitCount(x)) {
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
        }
#endif
        if ((sizeof(int) <= sizeof(long))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
        } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
            __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
        }
    }
    {
        int val;
        int ret = -1;
#if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
        Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
            x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
        if (unlikely(bytes_copied == -1)) {
        } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
            goto raise_overflow;
        } else {
            ret = 0;
        }
#elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
        int one = 1; int is_little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        ret = _PyLong_AsByteArray((PyLongObject *)x,
                                    bytes, sizeof(val),
                                    is_little, !is_unsigned);
#else
        PyObject *v;
        PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
        int bits, remaining_bits, is_negative = 0;
        int chunk_size = (sizeof(long) < 8) ? 30 : 62;
        if (likely(PyLong_CheckExact(x))) {
            v = __Pyx_NewRef(x);
        } else {
            v = PyNumber_Long(x);
            if (unlikely(!v)) return (int) -1;
            assert(PyLong_CheckExact(v));
        }
        {
            int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
            if (unlikely(result < 0)) {
                Py_DECREF(v);
                return (int) -1;
            }
            is_negative = result == 1;
        }
        if (is_unsigned && unlikely(is_negative)) {
            Py_DECREF(v);
            goto raise_neg_overflow;
        } else if (is_negative) {
            stepval = PyNumber_Invert(v);
            Py_DECREF(v);
            if (unlikely(!stepval))
                return (int) -1;
        } else {
            stepval = v;
        }
        v = NULL;
        val = (int) 0;
        mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
        shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
        for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
            PyObject *tmp, *digit;
            long idigit;
            digit = PyNumber_And(stepval, mask);
            if (unlikely(!digit)) goto done;
            idigit = PyLong_AsLong(digit);
            Py_DECREF(digit);
            if (unlikely(idigit < 0)) goto done;
            val |= ((int) idigit) << bits;
            tmp = PyNumber_Rshift(stepval, shift);
            if (unlikely(!tmp)) goto done;
            Py_DECREF(stepval); stepval = tmp;
        }
        Py_DECREF(shift); shift = NULL;
        Py_DECREF(mask); mask = NULL;
        {
            long idigit = PyLong_AsLong(stepval);
            if (unlikely(idigit < 0)) goto done;
            remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
            if (unlikely(idigit >= (1L << remaining_bits)))
                goto raise_overflow;
            val |= ((int) idigit) << bits;
        }
        if (!is_unsigned) {
            if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
                goto raise_overflow;
            if (is_negative)
                val = ~val;
        }
        ret = 0;
    done:
        Py_XDECREF(shift);
        Py_XDECREF(mask);
        Py_XDECREF(stepval);
#endif
        if (unlikely(ret))
            return (int) -1;
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* FastTypeChecks */
#if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* GetRuntimeVersion */
static unsigned long __Pyx_get_runtime_version(void) {
#if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
    return Py_Version & ~0xFFUL;
#else
    static unsigned long __Pyx_cached_runtime_version = 0;
    if (__Pyx_cached_runtime_version == 0) {
        const char* rt_version = Py_GetVersion();
        unsigned long version = 0;
        unsigned long factor = 0x01000000UL;
        unsigned int digit = 0;
        int i = 0;
        while (factor) {
            while ('0' <= rt_version[i] && rt_version[i] <= '9') {
                digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
                ++i;
            }
            version += factor * digit;
            if (rt_version[i] != '.')
                break;
            digit = 0;
            factor >>= 8;
            ++i;
        }
        __Pyx_cached_runtime_version = version;
    }
    return __Pyx_cached_runtime_version;
#endif
}

/* CheckBinaryVersion */
static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
    const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
    if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
        return 0;
    if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
        return 1;
    {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compile time Python version %d.%d "
                      "of module '%.100s' "
                      "%s "
                      "runtime version %d.%d",
                       (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
                       __Pyx_MODULE_NAME,
                       (allow_newer) ? "was newer than" : "does not match",
                       (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
       );
        return PyErr_WarnEx(NULL, message, 1);
    }
}

/* 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, "__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, "__pyx_capi__", d) < 0)
            goto bad;
    }
    tmp.fp = f;
    cobj = PyCapsule_New(tmp.p, sig, 0);
    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;
}

/* NewCodeObj */
#if CYTHON_COMPILING_IN_LIMITED_API
    static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                       PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                       PyObject *fv, PyObject *cell, PyObject* fn,
                                       PyObject *name, int fline, PyObject *lnos) {
        PyObject *exception_table = NULL;
        PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
        #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
        PyObject *version_info;
        PyObject *py_minor_version = NULL;
        #endif
        long minor_version = 0;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
        minor_version = 11;
        #else
        if (!(version_info = PySys_GetObject("version_info"))) goto end;
        if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
        minor_version = PyLong_AsLong(py_minor_version);
        Py_DECREF(py_minor_version);
        if (minor_version == -1 && PyErr_Occurred()) goto end;
        #endif
        if (!(types_module = PyImport_ImportModule("types"))) goto end;
        if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
        if (minor_version <= 7) {
            (void)p;
            result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else if (minor_version <= 10) {
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, fline, lnos, fv, cell);
        } else {
            if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
            result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
                          c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
        }
    end:
        Py_XDECREF(code_type);
        Py_XDECREF(exception_table);
        Py_XDECREF(types_module);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return result;
    }
#elif PY_VERSION_HEX >= 0x030B0000
  static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
                                         PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                         PyObject *fv, PyObject *cell, PyObject* fn,
                                         PyObject *name, int fline, PyObject *lnos) {
    PyCodeObject *result;
    result =
      #if PY_VERSION_HEX >= 0x030C0000
        PyUnstable_Code_NewWithPosOnlyArgs
      #else
        PyCode_NewWithPosOnlyArgs
      #endif
        (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
    return result;
  }
#elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
static PyObject* __Pyx_PyCode_New(
        const __Pyx_PyCode_New_function_description descr,
        PyObject * const *varnames,
        PyObject *filename,
        PyObject *funcname,
        const char *line_table,
        PyObject *tuple_dedup_map
) {
    PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL, *line_table_bytes = NULL;
    Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
    PyObject *varnames_tuple = PyTuple_New(var_count);
    if (unlikely(!varnames_tuple)) return NULL;
    for (Py_ssize_t i=0; i < var_count; i++) {
        Py_INCREF(varnames[i]);
        if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
    }
    #if CYTHON_COMPILING_IN_LIMITED_API
    varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
    if (!varnames_tuple_dedup) {
        if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
        varnames_tuple_dedup = varnames_tuple;
    }
    #else
    varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
    if (unlikely(!varnames_tuple_dedup)) goto done;
    #endif
    #if CYTHON_AVOID_BORROWED_REFS
    Py_INCREF(varnames_tuple_dedup);
    #endif
    if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL
        && !CYTHON_COMPILING_IN_GRAAL) {
        line_table_bytes = PyBytes_FromStringAndSize(line_table, descr.line_table_length);
        if (unlikely(!line_table_bytes)) goto done;
        Py_ssize_t code_len = (descr.line_table_length * 2 + 4) & ~3;
        code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
        if (unlikely(!code_bytes)) goto done;
        char* c_code_bytes = PyBytes_AsString(code_bytes);
        if (unlikely(!c_code_bytes)) goto done;
        memset(c_code_bytes, 0, (size_t) code_len);
    }
    code_obj = (PyObject*) __Pyx__PyCode_New(
        (int) descr.argcount,
        (int) descr.num_posonly_args,
        (int) descr.num_kwonly_args,
        (int) descr.nlocals,
        0,
        (int) descr.flags,
        code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        varnames_tuple_dedup,
        __pyx_mstate_global->__pyx_empty_tuple,
        __pyx_mstate_global->__pyx_empty_tuple,
        filename,
        funcname,
        (int) descr.first_line,
        (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table_bytes) ? line_table_bytes : __pyx_mstate_global->__pyx_empty_bytes
    );
done:
    Py_XDECREF(code_bytes);
    Py_XDECREF(line_table_bytes);
    #if CYTHON_AVOID_BORROWED_REFS
    Py_XDECREF(varnames_tuple_dedup);
    #endif
    Py_DECREF(varnames_tuple);
    return code_obj;
}

/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry const *t, PyObject **target, const char* const* encoding_names) {
    while (t->s) {
        PyObject *str;
        if (t->is_unicode) {
            if (t->intern) {
                str = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                str = PyUnicode_Decode(t->s, t->n - 1, encoding_names[t->encoding], NULL);
            } else {
                str = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            str = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        if (!str)
            return -1;
        *target = str;
        if (PyObject_Hash(str) == -1)
            return -1;
        ++t;
        ++target;
    }
    return 0;
}

#include <string.h>
static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
    size_t len = strlen(s);
    if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
        PyErr_SetString(PyExc_OverflowError, "byte string is too long");
        return -1;
    }
    return (Py_ssize_t) len;
}
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
    Py_ssize_t len = __Pyx_ssize_strlen(c_str);
    if (unlikely(len < 0)) return NULL;
    return PyByteArray_FromStringAndSize(c_str, len);
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if CYTHON_COMPILING_IN_LIMITED_API
    {
        const char* result;
        Py_ssize_t unicode_length;
        CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
        if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
        #else
        result = PyUnicode_AsUTF8AndSize(o, length);
        #endif
        #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        unicode_length = PyUnicode_GetLength(o);
        if (unlikely(unicode_length < 0)) return NULL;
        if (unlikely(unicode_length != *length)) {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
        #endif
        return result;
    }
#else
#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_UTF8
    if (PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
    if (PyByteArray_Check(o)) {
#if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
#else
        *length = PyByteArray_Size(o);
        if (*length == -1) return NULL;
        return PyByteArray_AsString(o);
#endif
    } else
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
    PyErr_Format(PyExc_TypeError,
                 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
                 result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  PyObject *res = NULL;
  if (likely(PyLong_Check(x)))
      return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  if (likely(m && m->nb_int)) {
      res = m->nb_int(x);
  }
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
      res = PyNumber_Long(x);
  }
#endif
  if (likely(res)) {
      if (unlikely(!PyLong_CheckExact(res))) {
          return __Pyx_PyNumber_LongWrongResultType(res);
      }
  }
  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 (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(__Pyx_PyLong_IsCompact(b))) {
        return __Pyx_PyLong_CompactValue(b);
    } else {
      const digit* digits = __Pyx_PyLong_Digits(b);
      const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyLong_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyLong_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
    CYTHON_UNUSED_VAR(b);
    return __Pyx_NewRef(Py_None);
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
    return PyLong_FromSize_t(ival);
}


/* MultiPhaseInitModuleState */
#if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
#ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
#else
  #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
#endif
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
#error "Module state with PEP489 requires atomics. Currently that's one of\
 C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
#endif
#if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
#define __Pyx_ModuleStateLookup_Lock()
#define __Pyx_ModuleStateLookup_Unlock()
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
#define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(__cplusplus) && __cplusplus >= 201103L
#include <mutex>
static std::mutex __Pyx_ModuleStateLookup_mutex;
#define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
#define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
#elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
#include <threads.h>
static mtx_t __Pyx_ModuleStateLookup_mutex;
static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
    mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
}
#define __Pyx_ModuleStateLookup_Lock()\
  call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  mtx_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(HAVE_PTHREAD_H)
#include <pthread.h>
static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
#define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
#elif defined(_WIN32)
#include <Windows.h>  // synchapi.h on its own doesn't work
static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
#define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
#else
#error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
 Requires C standard >= C11, or C++ standard >= C++11,\
 or pthreads, or the Windows 32 API, or Python >= 3.13."
#endif
typedef struct {
    int64_t id;
    PyObject *module;
} __Pyx_InterpreterIdAndModule;
typedef struct {
    char interpreter_id_as_index;
    Py_ssize_t count;
    Py_ssize_t allocated;
    __Pyx_InterpreterIdAndModule table[1];
} __Pyx_ModuleStateLookupData;
#define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
#endif
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
#else
static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
#endif
static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
        __Pyx_InterpreterIdAndModule* table,
        Py_ssize_t count,
        int64_t interpreterId) {
    __Pyx_InterpreterIdAndModule* begin = table;
    __Pyx_InterpreterIdAndModule* end = begin + count;
    if (begin->id == interpreterId) {
        return begin;
    }
    while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
        __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
        if (halfway->id == interpreterId) {
            return halfway;
        }
        if (halfway->id < interpreterId) {
            begin = halfway;
        } else {
            end = halfway;
        }
    }
    for (; begin < end; ++begin) {
        if (begin->id >= interpreterId) return begin;
    }
    return begin;
}
static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return NULL;
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
    {
        __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        if (likely(data)) {
            __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
            if (likely(data == new_data)) {
                goto read_finished;
            }
        }
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
        __Pyx_ModuleStateLookup_Lock();
        __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
        data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
        __Pyx_ModuleStateLookup_Unlock();
    }
  read_finished:;
#else
    __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_InterpreterIdAndModule* found = NULL;
    if (unlikely(!data)) goto end;
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            found = data->table+interpreter_id;
        }
    } else {
        found = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
    }
  end:
    {
        PyObject *result=NULL;
        if (found && found->id == interpreter_id) {
            result = found->module;
        }
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
        __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
#endif
        return result;
    }
}
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
    while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
}
#else
#define __Pyx_ModuleStateLookup_wait_until_no_readers()
#endif
static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
    Py_ssize_t to_allocate = (*old_data)->allocated;
    while (to_allocate <= interpreter_id) {
        if (to_allocate == 0) to_allocate = 1;
        else to_allocate *= 2;
    }
    __Pyx_ModuleStateLookupData *new_data = *old_data;
    if (to_allocate != (*old_data)->allocated) {
         new_data = (__Pyx_ModuleStateLookupData *)realloc(
            *old_data,
            sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
        if (!new_data) {
            PyErr_NoMemory();
            return -1;
        }
        for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
            new_data->table[i].id = i;
            new_data->table[i].module = NULL;
        }
        new_data->allocated = to_allocate;
    }
    new_data->table[interpreter_id].module = module;
    if (new_data->count < interpreter_id+1) {
        new_data->count = interpreter_id+1;
    }
    *old_data = new_data;
    return 0;
}
static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
    __Pyx_InterpreterIdAndModule *read = data->table;
    __Pyx_InterpreterIdAndModule *write = data->table;
    __Pyx_InterpreterIdAndModule *end = read + data->count;
    for (; read<end; ++read) {
        if (read->module) {
            write->id = read->id;
            write->module = read->module;
            ++write;
        }
    }
    data->count = write - data->table;
    for (; write<end; ++write) {
        write->id = 0;
        write->module = NULL;
    }
    data->interpreter_id_as_index = 0;
}
static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    int result = 0;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
#endif
    __Pyx_ModuleStateLookupData *new_data = old_data;
    if (!new_data) {
        new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
        if (!new_data) {
            result = -1;
            PyErr_NoMemory();
            goto end;
        }
        new_data->allocated = 1;
        new_data->interpreter_id_as_index = 1;
    }
    __Pyx_ModuleStateLookup_wait_until_no_readers();
    if (new_data->interpreter_id_as_index) {
        if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
            result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
            goto end;
        }
        __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
    }
    {
        Py_ssize_t insert_at = 0;
        {
            __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
                new_data->table, new_data->count, interpreter_id);
            assert(lower_bound);
            insert_at = lower_bound - new_data->table;
            if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
                lower_bound->module = module;
                goto end;  // already in table, nothing more to do
            }
        }
        if (new_data->count+1 >= new_data->allocated) {
            Py_ssize_t to_allocate = (new_data->count+1)*2;
            new_data =
                (__Pyx_ModuleStateLookupData*)realloc(
                    new_data,
                    sizeof(__Pyx_ModuleStateLookupData) +
                    (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
            if (!new_data) {
                result = -1;
                new_data = old_data;
                PyErr_NoMemory();
                goto end;
            }
            new_data->allocated = to_allocate;
        }
        ++new_data->count;
        int64_t last_id = interpreter_id;
        PyObject *last_module = module;
        for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
            int64_t current_id = new_data->table[i].id;
            new_data->table[i].id = last_id;
            last_id = current_id;
            PyObject *current_module = new_data->table[i].module;
            new_data->table[i].module = last_module;
            last_module = current_module;
        }
    }
  end:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
#else
    __Pyx_ModuleStateLookup_data = new_data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return result;
}
static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
    int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
    if (interpreter_id == -1) return -1;
    __Pyx_ModuleStateLookup_Lock();
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
            __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
#else
    __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
#endif
    if (data->interpreter_id_as_index) {
        if (interpreter_id < data->count) {
            data->table[interpreter_id].module = NULL;
        }
        goto done;
    }
    {
        __Pyx_ModuleStateLookup_wait_until_no_readers();
        __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
            data->table, data->count, interpreter_id);
        if (!lower_bound) goto done;
        if (lower_bound->id != interpreter_id) goto done;
        __Pyx_InterpreterIdAndModule *end = data->table+data->count;
        for (;lower_bound<end-1; ++lower_bound) {
            lower_bound->id = (lower_bound+1)->id;
            lower_bound->module = (lower_bound+1)->module;
        }
    }
    --data->count;
    if (data->count == 0) {
        free(data);
        data = NULL;
    }
  done:
#if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
    __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
#else
    __Pyx_ModuleStateLookup_data = data;
#endif
    __Pyx_ModuleStateLookup_Unlock();
    return 0;
}
#endif

/* #### Code section: utility_code_pragmas_end ### */
#ifdef _MSC_VER
#pragma warning( pop )
#endif



/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
